Re: [R] Text dependent on a variable in a R function

2010-05-03 Thread Duncan Murdoch
Jim Lemon wrote: On 05/02/2010 10:00 PM, Duncan Murdoch wrote: ... I've seen this description a couple of times lately, and I think it's worth pointing out that it's misleading. The deparse(substitute(x)) trick returns the *expression* that was passed to the argument x. Sometimes that's the n

Re: [R] Text dependent on a variable in a R function

2010-05-03 Thread Jim Lemon
On 05/02/2010 10:00 PM, Duncan Murdoch wrote: ... I've seen this description a couple of times lately, and I think it's worth pointing out that it's misleading. The deparse(substitute(x)) trick returns the *expression* that was passed to the argument x. Sometimes that's the name of a variable, bu

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread nikhil kaza
Thats right. serves me for not checking the code before posting. but paste should work in anycase with collapse or when x is a single parameter. Nikhil On Sun, May 2, 2010 at 10:24 AM, David Winsemius wrote: > > On May 2, 2010, at 10:10 AM, Nikhil Kaza wrote: > > say x is the variable. >> >> p

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread David Winsemius
On May 2, 2010, at 10:10 AM, Nikhil Kaza wrote: say x is the variable. plot(..., title=paste(x, "whatever else"), ...) should work as well. same should work with file names as well. Perhaps in an alternate universe it might, ... but it doesn't in this one. "title" is not the correct par

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread Nikhil Kaza
say x is the variable. plot(..., title=paste(x, "whatever else"), ...) should work as well. same should work with file names as well. Nikhil On May 1, 2010, at 9:56 PM, R K wrote: Hello, I was wondering if someone could tell me how I can make text dependent on a variable in a R functio

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread Duncan Murdoch
On 02/05/2010 4:07 AM, Jim Lemon wrote: On 05/02/2010 11:56 AM, R K wrote: Hello, I was wondering if someone could tell me how I can make text dependent on a variable in a R function I have created. The function will create plots, thus I would like each plot to have a unique title based o

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread Jim Lemon
On 05/02/2010 11:56 AM, R K wrote: Hello, I was wondering if someone could tell me how I can make text dependent on a variable in a R function I have created. The function will create plots, thus I would like each plot to have a unique title based on the inputted variable as well as a unique

Re: [R] Text dependent on a variable in a R function

2010-05-01 Thread Charles C. Berry
On Sun, 2 May 2010, R K wrote: Hello, I was wondering if someone could tell me how I can make text dependent on a variable in a R function I have created. example( deparse ) HTH, Chuck The function will create plots, thus I would like each plot to have a unique title based on

[R] Text dependent on a variable in a R function

2010-05-01 Thread R K
Hello, I was wondering if someone could tell me how I can make text dependent on a variable in a R function I have created. The function will create plots, thus I would like each plot to have a unique title based on the inputted variable as well as a unique file name when saved using the sa