Closed heejongkim closed 4 years ago
Well, I'm not familiar with rlang
but you can always construct a character-based formula and convert that. For example:
abundance_column_name <- "abundance"
frm <- paste(abundance_column_name, " ~ mean(", abundance_column_name ")")
impute_proxy(data, as.formula(frm))
The crux is the as.formula
function that converts an appropriate string to a formula
object.
Hi, I wonder if this package can handle !!as.name-like way to provide variable name by providing the variable with the string.
Ex. IMPUTED_VARIABLES ~ MODEL_SPECIFICATION [ | GROUPING_VARIABLES ]
instead of directly specifying the column name: abundance ~ mean(abundance) | group
I'd like to do something like: abundance_column_name <- "abundance" !!as.name(abundance_column_name) ~ mean(!!as.name(abundance_column_name)) | group
will it be possible with the current implementation?
best, hee jong kim