I am trying to write a small test that will check whether the column supplied is numeric
fun_df <- function(data,x){
if(is.numeric(data$x){
stop("done!")
}
print("did not pass")
}
fun_df(cars, dist)
what will be the best way to specify is.numeric(data$x)? i tried {{x}}, !!x. but I can't get the test pass. I specifically want to specify fun_df(cars, dist) and not fun_df(cars, "dist")