Finding name of variable supplied as function argument
I could of course do this the tedious way by simply entering the name-strings "G1", "G2" as arguments as well as the variable names G1, G2, in a call like meds3x3(G1,G2,"G1","G2") But I'd like to simply be able to pick up, within the function, the names of the variables that were used as arguments in the function call.
does the following help Ted?
test <- function(x) {
actual <- deparse(substitute(x))
paste('argument passed was called', actual)
}
test(happy)
test(apple)