LocalEpi / LEMMA-Forecasts

Outputs of the LEMMA model for COVID-19 forecasts
MIT License
6 stars 2 forks source link

error in `GetCountySheets` #6

Closed slwu89 closed 3 years ago

slwu89 commented 3 years ago

I get an error when hitting this line of code: https://github.com/LocalEpi/LEMMA-Forecasts/blob/47a37d74298c5b876ba0a72c2ee31a846d257ef5/Code/RunCountiesFromBeginning.R#L56

Population is a data.table with 58 rows and 23 columns, and population$age <- c(0, 5, 12, 16, 16, 16, 16, 16, 16, 30, 30, 40, 40, 50, 50, 50, 50, 65, 65, 65, 75, 75, 85) is assigning a new column with only 23 rows, so it throws an error. Is that meant to be another row labeled age?

The error data.table returns is:

Error in set(x, j = name, value = value) : 
  Supplied 23 items to be assigned to 58 items of column 'age'. If you wish to 'recycle' the RHS please use rep() to make this intent clear to readers of your code.
slwu89 commented 3 years ago

Solved, thanks @joshuaschwab . This line should match the version that does the local data import https://github.com/slwu89/LEMMA-Forecasts/blob/feat/adjust-for-shiny/Code/RunCountiesFromBeginning.R#L59