Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-11 Thread Hans Ekbrand
On Sat, Mar 10, 2012 at 04:01:21PM -0800, casperyc wrote: Sorry if I wasn't stating what I really wanted or it was a bit confusing. Basically, there are MANY datasets to run suing the same function I have written a function to analyze it and returns a LIST of useful out put in the variable

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-11 Thread casperyc
Thank you everyone for your reply. Like I said in my original post, this is just a demonstrative example of my 'big' self written script. My 'big' function take several inputs, of which the first 1 is the dataset and returns a LIST variable 'res-list()' to the workspace with many information.

[R] function input as variable name (deparse/quote/paste) ??

2012-03-10 Thread casperyc
Hi all Say I have a function: myname=function(dat,x=5,y=6){ res-x+y-dat } for various input such as myname(dat1) myname(dat2) myname(dat3) myname(dat4) myname(dat5) how should I modify the 'res' line, to have new informative variable name correspondingly, such as dat1.res dat2.res

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-10 Thread Hans Ekbrand
On Sat, Mar 10, 2012 at 01:29:16PM -0800, casperyc wrote: Hi all Say I have a function: myname=function(dat,x=5,y=6){ res-x+y-dat } for various input such as myname(dat1) myname(dat2) myname(dat3) myname(dat4) myname(dat5) how should I modify the 'res' line, to have new

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-10 Thread Thomas Lumley
On Sun, Mar 11, 2012 at 10:29 AM, casperyc caspe...@hotmail.co.uk wrote: Hi all Say I have a function: myname=function(dat,x=5,y=6){    res-x+y-dat } for various input such as myname(dat1) myname(dat2) myname(dat3) myname(dat4) myname(dat5) how should I modify the 'res' line, to

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-10 Thread casperyc
Sorry if I wasn't stating what I really wanted or it was a bit confusing. Basically, there are MANY datasets to run suing the same function I have written a function to analyze it and returns a LIST of useful out put in the variable 'res' (to the workspace). I also created another script run.r

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-10 Thread Berend Hasselman
On 11-03-2012, at 01:01, casperyc wrote: Sorry if I wasn't stating what I really wanted or it was a bit confusing. Basically, there are MANY datasets to run suing the same function I have written a function to analyze it and returns a LIST of useful out put in the variable 'res' (to the