Re: [R] R newbie...

From: David Hajage <dhajage_at_gmail.com>
Date: Wed 07 Dec 2005 - 04:46:52 EST

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 ?

2005/12/6, Sarah Goslee <sarah.goslee@gmail.com>:
>
> First of all, you might try reading the manual.
>
> Second, you might try something like this:
>
> calculate <- function(x,y)
> {
> z <- x + y z
> }
>
> recalculate(z)
> {
> a <- z^2
> a
> }
>
> z <- calculate(x, y)
> recalculate(z)
>
> You need to return some value from your functions,
> and you need to assign that value to a variable.
>
> Sarah
>
>
> --
> Sarah Goslee
> http://www.stringpage.com

--
David

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Dec 07 05:24:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:29 EST