[R] retrieve from function

threshold r.kozarski at gmail.com
Fri Feb 19 18:39:37 CET 2010


Hi, say I got the function:
> x=function(nbr){y<-rnorm(nbr);y1 <- mean(y);plot(y)}

how can I retrieve value of y1, when I need it. 

I don't want:
> x=function(nbr){y<-rnorm(nbr);y1 <<- mean(y);plot(y)}
> y1

I want someting like:
"x$y1" and then I get the value

Many thanks, robert





-- 
View this message in context: http://n4.nabble.com/retrieve-from-function-tp1561972p1561972.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list