However, this is not compatible with native pipe for R versions <4.2 (which have no placeholder). A purist would even go further and advocate against placeholders per se.
Note that many people are stuck with R v4.1 due to external limitations such as with rstan.
It would be great if you could write it lst(x = 1) %>% list_modify(x2 = x+1), just like you would do with dplyr::mutate().
Hi,
list_modify()
is a wonderful tool, but it does not keep a reference to the LHS of the pipe.Therefore, to use it like
dplyr::mutate()
, you should use the.
placeholder withmagrittr
pipes.Created on 2023-01-31 with reprex v2.0.2
However, this is not compatible with native pipe for R versions <4.2 (which have no placeholder). A purist would even go further and advocate against placeholders per se. Note that many people are stuck with R v4.1 due to external limitations such as with rstan.
It would be great if you could write it
lst(x = 1) %>% list_modify(x2 = x+1)
, just like you would do withdplyr::mutate()
.Do you think that is doable?