You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was quite surprised to see that accumulate_right and accumulate do not keep the names of the input list.
For my case it makes perfect sense to do so, because I am aggregating along a hierarchy.
Maybe there should be an argument to accumulate(_right) for keeping the names?
For compatibility it might be like this:
l %<>% accumulate(myfun) -> no names l %<>% accumulate(myfun, .keep_names = TRUE) -> leaves names(l) untouched
Currently I work around this with l %<>% {set_names(accumulate(., myfun), names(.)) wich is somewhat clunky.
I could submit a PR with the necessary changes if desired.
The text was updated successfully, but these errors were encountered:
Implement tidyverse#446.
Maybe `.keep_names = TRUE` is a better default?
`.keep_names = FALSE` as default matches the original behaviour, but I can hardly imagine code relying on the fact that `accumulate(...)` is unnamed.
I was quite surprised to see that accumulate_right and accumulate do not keep the names of the input list.
For my case it makes perfect sense to do so, because I am aggregating along a hierarchy.
Maybe there should be an argument to accumulate(_right) for keeping the names?
For compatibility it might be like this:
l %<>% accumulate(myfun)
-> no namesl %<>% accumulate(myfun, .keep_names = TRUE)
-> leavesnames(l)
untouchedCurrently I work around this with
l %<>% {set_names(accumulate(., myfun), names(.))
wich is somewhat clunky.I could submit a PR with the necessary changes if desired.
The text was updated successfully, but these errors were encountered: