Skip to content
Prev 325659 / 398503 Next

Returning name of dataframe?

I am writing a function and I would like to return the name of a data frame
in a paste call, but I can't figure out how to just get the name. The names
of the data frames used, won't be the same each time.  I have to be
overlooking the obvious.

#For example:

a<-replicate(5, rnorm(20))
b<-replicate(5, rnorm(20))

xyz<-function(x,y){
  z<-x+y
  print(paste("the sum of", x, "and", y,"is", sep=" "))
  z 
}

xyz(a,b)

#That function should return:
Not surprisingly, it returns all the data in the data frame.

Thanks,
Thomas