I want to pass a variable name into a function and can't seem to do it. Simply...
library (reshape)
test <- function(x) {
cast(data, x ~ ., length)
}
test(ageg)
I get this kickback.
Error: Casting formula contains variables not found in molten data: x
I know it's simple but I can't find the answer.I want it to simply run
cast(data, ageg ~ ., length)