In BEAData_wAPI.R, two time series datasets are created (i.e., State_CompensationByIndustry_2012_0.4.0.rds through State_CompensationByIndustry_2023_0.4.0.rds and State_WagesByIndustry_2012_0.4.0.rds through State_WagesByIndustry_2023_0.4.0.rds); however, the API call, which returns all years (i.e., 1998-present) is not parsed by the given year and, therefore, each time series RDS file has a 1998–2025 time series. The code that reads these RDS files correctly pulls the "year_col," which would be found regardless of the file selected (all years are in all files). The operation, however, differs from how other annual RDS files are stored and you end up with the same dataset duplicated several times.
Example of no year filtering before saving to RDS:
Example of year filtering before saving to RDS:
|
df <- StateData[StateData$GeoName %in% geo_names, |
Consider adding a column selection for df that includes only the year of interest after the reshape to wide table.
In BEAData_wAPI.R, two time series datasets are created (i.e., State_CompensationByIndustry_2012_0.4.0.rds through State_CompensationByIndustry_2023_0.4.0.rds and State_WagesByIndustry_2012_0.4.0.rds through State_WagesByIndustry_2023_0.4.0.rds); however, the API call, which returns all years (i.e., 1998-present) is not parsed by the given year and, therefore, each time series RDS file has a 1998–2025 time series. The code that reads these RDS files correctly pulls the "year_col," which would be found regardless of the file selected (all years are in all files). The operation, however, differs from how other annual RDS files are stored and you end up with the same dataset duplicated several times.
Example of no year filtering before saving to RDS:
stateior/data-raw/BEAData_wAPI.R
Line 9 in fc60e11
Example of year filtering before saving to RDS:
stateior/data-raw/BEAData.R
Line 84 in fc60e11
Consider adding a column selection for
dfthat includes only the year of interest after the reshape to wide table.