Re: [R] How to return more than one variable from function

2007-04-21 Thread Vincent Goulet
Le Vendredi 20 Avril 2007 11:23, vous avez écrit : From: Vincent Goulet Le Vendredi 20 Avril 2007 07:46, Julien Barnier a écrit : Hi, 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. You

[R] How to return more than one variable from function

2007-04-20 Thread vinod gullu
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.

Re: [R] How to return more than one variable from function

2007-04-20 Thread jim holtman
use a 'list' as the return value containing the values you want returned. x- function(){ . list(val1=a, val2=b, val3=c) } On 4/20/07, vinod gullu [EMAIL PROTECTED] 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

Re: [R] How to return more than one variable from function

2007-04-20 Thread Julien Barnier
Hi, 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. You can return a vector, or a list. For example : func - function() { ... result - list(variance=3, sd=sqrt(3)) return(result) # you can omit this

Re: [R] How to return more than one variable from function

2007-04-20 Thread Vincent Goulet
Le Vendredi 20 Avril 2007 07:46, Julien Barnier a écrit : Hi, 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. You can return a vector, or a list. For example : func - function() { ... result -

Re: [R] How to return more than one variable from function

2007-04-20 Thread Ron Michael
?list - Original Message From: vinod gullu [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Friday, April 20, 2007 5:00:45 PM Subject: [R] How to return more than one variable from function Dera R users, I have written a function which computes variance, sd, r^2, R^2adj etc. But i

Re: [R] How to return more than one variable from function

2007-04-20 Thread Liaw, Andy
From: Vincent Goulet Le Vendredi 20 Avril 2007 07:46, Julien Barnier a écrit : Hi, 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. You can return a vector, or a list. For example : func