One line change to pass next data.table release please
Dear Alec,
Thanks for your reply on email supporting this change in data.table.
https://github.com/Rdatatable/data.table/pull/3310
https://github.com/Rdatatable/data.table/issues/3347
I've tested irg
and it's just a one line change that's needed :
https://gitlab.com/robit.a/irg/blob/master/R/model.R#L316
from :
fitDT <- DT[rep(1:.N, each = 366)][, t := julseq$t]
to :
fitDT <- DT[rep(1:.N, each = 366)][, t := rep(julseq$t, length.out=.N)]
Will you be able to update irg on CRAN please?
Best, Matt
(I wasn't sure how to submit pull request on GitLab. I hope as an issue is ok.)
The error without this fix is :
> fit <- model_ndvi(mods, observed = FALSE)
Error in `[.data.table`(DT[rep(1:.N, each = 366)], , `:=`(t, julseq$t)) :
Supplied 366 items to be assigned to 40260 items of column 't'. The RHS length must either be 1 (single values are ok) or match the LHS length exactly. If you wish to 'recycle' the RHS please use rep() explicitly to
make this intent clear to readers of your code.
Calls: model_ndvi -> [ -> [.data.table
Execution halted
Edited by Matt Dowle