Thanks a lot Tony and Daniel for making that clear.

best,

Steve



Stropharia wrote:
> 
> Hi everyone,
> 
> i'm having a problem extracting objects out of functions i've created, so
> i can use them for further analysis. Here's a small example:
> 
> # ---------------------------
> test <- function(i, j){
>       x <- i:j
>       y <- i*j
>       z <- i/j
>       return(x,y,z)
> }
> # ---------------------------
> 
> This returns the 3 objects as $x, $y and $z. I cannot, however, access
> these objects individually by typing for example:
> 
> test$x
> 
> I know i can do this by adding an extra arrow head to the assignment arrow
> (<<-), but I am sure that is not how it is done in some of the established
> R functions (like when calling lm$coef out of the lm function). Is there a
> simple command i've omitted from the function that allows access to
> objects inside it?
> 
> Thanks in advance,
> 
> Steve
> 

-- 
View this message in context: 
http://www.nabble.com/Reuse-objects-from-within-a-custom-made-function-tp25864695p25866081.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to