Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Percentages of pivot table variable from the Grand Total is correctly executed but then I got problems with Clean and Install in R #72

Open
martakis opened this issue Jul 22, 2024 · 0 comments

Comments

@martakis
Copy link

martakis commented Jul 22, 2024

I gotPercentages of pivot table variable from the Grand Total is correctly executed but then I got problems with Clean and Install in R
I have a problem with the Build-Clean and install of my package ACRER in RStudio (version 2024.04.2+764 (2024.04.2+764) and
R (version.4.4.1) on my mac-mini with Sonoma 14.5 operating system

The objective of my project was to estimate the sum of number of visits and the total of expected_visiting_duration from the city of Wageningen with 9 zip codes (6701-6709)to 33 recreation areas having a distance between 0.35 to 37.1 km from the city of Wageningen. These results have been obtained from my model ACRER and are stored on the Excel file fdata20.xlsx with 82689 records and 14 variables named:RecrID,activity_pattern_definition,transport_type_ID,transport_type_definition,Time_segment,zip_code,recreation_areas, Time_available_per_time_segment,distances_km,total_activities_costs,fuel_cost_total,expected_visiting_duration,number_of_visits. where only mentioned the relative variables for the construction of the pivot tables.
I shall try to simplify my problem with the following 2 R projects:

  1. pivottablesmodels3.Rproj and
  2. pivottablesmodels4.Rproj

Both R projects have the same data file: fdata20.xlsx
In the pivottablesmodels3.Rproj in the R file:
pivot_model3.R I have set up 3 pivot tables with the use of the package pivotabler according to the instructions of the author: Christopher Bailiss.
For the pivot_model3.R the following 3 pivot tables have been generated:
The sum of the number of visits per location. The rows are the recreation areas and the columns are zip codes.
total of expected visiting duration The rows are the recreation areas and the columns are zip codes. and
distance, total fuel cost, total activities cost, Sum of the number of visits, and total expected visiting duration.
.
For the pivot_model4.R the following 4 pivot tables have been generated:
The sum of the number of visits per location. The rows are the recreation areas and the columns are zip codes.
total of expected visiting duration The rows are the recreation areas and the columns are zip codes. and
distance, total fuel cost, total activities cost, Sum of number of visits, and total expected visiting duration.
percentage of the number of visits per Grand total.
.
Both projects created the pivot tables on the Excel workbook:
Wageningen_crosstables.xlsx and Wageningen_crosstables4.xlsx correctly. However when I tried to clean and install for the project: pivottablesmodels3.Rproj was DONE to the contrary of the project: pivottablesmodels4.Rproj (see Clean_Install3.rtf and Clean_Install4.rtf and see bellow).

==> R CMD INSTALL --preclean --no-multiarch --with-keep.source pivottablesmodels4

  • installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’
  • installing source package ‘pivottablesmodels4’ ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    [1] "Sum of number of visits per location"
    [1] "calculate the total of expected_visiting_duration"
    [1] "total costs"
    [1] "additional variables: distance, total fuel cost, total activities cost"
    [1] "% number of visits Grand total"
    Error in base::union(x, y, ...) : unused argument (list())
    Calls: ... -> envlist -> -> union -> union.default
    Execution halted
    ERROR: lazy loading failed for package ‘pivottablesmodels4’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/pivottablesmodels4’

I would appreciate hearing from you to solve the abovementioned problen of cleaning and installing the package when in the generated tables of percentages from total rows or columns or from the Grand total.

PivottablesmodelX.zip

@martakis martakis changed the title Percentages of pivot table variable from the Grand Total is correct executed but then arised problems with Clean and Install in R Percentages of pivot table variable from the Grand Total is correctly executed but then I got problems with Clean and Install in R Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant