[R] how to make a function recognize the name of an object/vector given as argument

2009-09-24 Thread Wolfgang Raffelsberger
Dear guRus, I'd like to learn how to make a function recognize the name of an object/vector given as argument If I have : testFun - function(x,y) plot(x,y, main=paste(plot of,names(x),and,names(y)) ) # this just a simple example ... a1 - 5:8 b1 - 9:6 testFun(a1,b1) # Returns the plot,

Re: [R] how to make a function recognize the name of an object/vector given as argument

2009-09-24 Thread baptiste auguie
Try this, testFun - function(x,y) plot(x,y, main=paste(plot of,deparse(substitute(x)),and, deparse(substitute(y))) ) a1 - 5:8 b1 - 9:6 testFun(a1,b1) ?deparse HTH, baptiste 2009/9/24 Wolfgang Raffelsberger wr...@igbmc.fr: Dear guRus, I'd like to learn how to make a function recognize