On 29/07/10 04:21, Jeremy Miles wrote:
I'd like a function that returns the variable name.
As in:
MyData$Var1
Would return:
Var1
Not quite sure what you mean, but does this get you started?
nn <- function(x) deparse(substitute(x))
str( z <- nn(airquality$Month) )
# chr "airquality$Mon
I'd like a function that returns the variable name.
As in:
MyData$Var1
Would return:
Var1
There should be a straightforward way to do this, but I can't see it.
Thanks,
Jeremy
--
Jeremy Miles
Psychology Research Methods Wiki: www.researchmethodsinpsychology.com
__
2 matches
Mail list logo