[R] How to return more than one variable from function
jholtman at gmail.com
Fri Apr 20 13:38:51 CEST 2007
use a 'list' as the return value containing the values you want returned.
list(val1=a, val2=b, val3=c)
On 4/20/07, vinod gullu <vinodkgul at yahoo.com> wrote:
> Dera R users,
> I have written a function which computes variance, sd,
> r^2, R^2adj etc. But i am not able to return all of
> them in return statement.
> So how to return more than one variable from
> function. In C i used to return by pointers etc. is
> there any way like that.
> Thanks in advance.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help