-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
After #7314 our simplify rules got very wide. The PR meant to add handling for adaptive rolling median.
Considering frollapply manual says
In future version we may improve internal \code{simplifylist} function, then \code{simplify=TRUE} may return object of a different type, breaking downstream code. If results are already simplified with \code{simplify=TRUE}, then it can be considered backward compatible.
it is risky to keep current simplify rules and this statement together.
We should either:
- change manual that even simplified results may not be considered backward compatible
- or make simplify to work for a less cases
If we go with 2. then this issue can be good for agreeing on the scope of simplifylist().
- absolute minimum are:
- coerce int to double when varies within answer results (frollapply simplifylist could be more smart about median results #7313)
list(NA, 1.5, 2L)->c(NA, 1.5, 2) - coerce
fillto answers type
list(NA, 1L, 2L)->c(NA_integer_, 1L, 2L)
list(-9, 1L, 2L)->c(-9L, 1L, 2L) unlistfor atomic vector of matching types
list(1, 2, 3)->c(1,2,3)rbindlistof list/df/dt of matching dimension and types
list(dt(a=1, b=2), dt(a=2, b=3))- >dt(a=1:2, b=2:3)
- nice to have
- recycle
fillto answers length
list(NA, 1:2)->list(c(NA,NA), 1:2) - match
fillnames to answers names
list(NA, c(a=1,b=2))->list(c(a=NA,b=NA), c(a=1,b=2)) rbindlist(lapply(x, as.list))of length 2+ vectors
list(1:2, 2:3)- >dt(1:2, 2:3)