Skip to content

Duplicate time series of State Compensation and Wages by Industry tables #8

Description

@dt-woods

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:

for(year in years) {

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions