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.
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, andpopulation$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: