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:

>"the sum of a and b is:"
>.and some data.

Not surprisingly, it returns all the data in the data frame.

Thanks,
Thomas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to