Hi All,
I was wondering if it was possible to identify what the class of a variable is within a quasiquotation context.
At present, the only way I can think to do this is to pull it into a vector, and then identify it. But this seems a bit messy and long-winded.
Maybe there is a function in rlang
to do this??
Thanks!
library(tidyverse)
what_class <- function(data, x_var) {
x_var <- rlang::enquo(x_var)
# function to identify the class of x_var here
}
what_class(iris, Species)