Closed samuelhuerga closed 6 years ago
This is not possible by construction.
well I guess you could do it with eval_tidy(quo(mutate(df, !!f_q)))
but this is convoluted.
Maybe you'll have better luck unquote-splicing a named list with !!!
if you don't know in advance which arguments are named? You can !!!
a list that has named and/or unnamed elements (even if this list only has one element).
Thanks Lionel,
The list approach reminds me of mutate_ of dplyr 0.5, where I started mutating df based on strings.
I think I'll encapsulate your options in a function in order to reuse and change as little as possible in all my code.
Thanks!
Hi,
I am wondering about how to use strings with new rlang in order to mutate a dataframe. Until now, I've prepared a string with the operation I want to do (and use of
:=
in order properly assign the name of new variable. Thenparse_expr
, and then mutate with!!
.It also worked with multiple variables, with
map(parse_expr)
and!!!
.However, now I found that this is no longer allowed.
I would like to know how can I, based on strings, mutate a dataframe with rlang.
With version 0.1.6:
Thanks!