[R] R newbie...

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Dec 6 19:01:45 CET 2005


David Hajage wrote:

> Hello,
> 
> I'm a new user...
> 
> I have a function :
> 
> calculate <- function(x,y)
>   {
>      z <- x + y

# insert:
   z

>   }
> I would like to use the result (z) with another function :
> 
> recalculate <- function(...)
>   {
>      a <- z^2
# insert:
   a

>   }

Type:

recalculate(calculate(3,4))


Please read "An Introduction to R" as well as the posting guide!


Uwe Ligges


> But R says that z does not exist...
> 
> How can I use z in an another function ?
> 
> Thank you for your answer...
> 
> --
> David
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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




More information about the R-help mailing list