[R] R newbie...

paul sorenson sourceforge at metrak.com
Tue Dec 6 19:48:49 CET 2005


Return something that can hold more than one value, eg:

calculate <- function(x, y) {
	list(a=x+y, b=x-y)
}

David Hajage wrote:
> Thank you for your answer.
> 
> And what if my first function gives 2 results :
> 
> calculate <- function(x,y)
> {
>     a <- x + y
>      b <- x - y
> }
> 
> How can I use both a and b in a new function ?




More information about the R-help mailing list