[R] Obtaining name of data frame used in a function argument

2010-03-11 Thread Jason Baucom
I'm writing a function that can take a data.frame as an argument. I'd like to be able to obtain the name of the data.frame and print it out within the function. My current function looks like this: examineIt-function(x) { print(nrow(x)) print(x[ceiling(runif(10)*nrow(x)),])

Re: [R] Obtaining name of data frame used in a function argument

2010-03-11 Thread Henrique Dallazuanna
Try this: foo - function(data)print(deparse(substitute(data))) foo(DF) On Thu, Mar 11, 2010 at 2:31 PM, Jason Baucom jason.bau...@ateb.com wrote: I'm writing a function that can take a data.frame as an argument. I'd like to be able to obtain the name of the data.frame and print it out within