hadley / lazyeval

Lazy evaluation: an alternative to non-standard evaluation (NSE) for R
131 stars 40 forks source link

Optionally use LHS of formula as name #59

Closed hadley closed 8 years ago

hadley commented 8 years ago

In order to do, e.g.

var <- "mpg"
dplyr::mutate_(mtcars, list(paste0(var, "2") ~ uq(var) * 2))

Maybe that implies we want

f_list(paste0(var, "2") ~ uq(var) * 2)

to be equivalent to

f_list(mpg2 = ~uq(var) * 2)

i.e. we iterate over a list extracting replacing the name with the evaluated LHS.

hadley commented 8 years ago

Need to think through whether SE functions should use ... or list(), and if that depends on whether or not you're using NSE as well.

hadley commented 8 years ago

Also need to support uq() on the RHS