Message-ID: <3C8F9BF9-5044-43D4-9B8A-FBD32F46BA9A@exeter.ac.uk>
Date: 2008-09-26T15:33:07Z
From: Baptiste Auguie
Subject: Return a list
In-Reply-To: <48DD066B.21927.E420D@fritsch.bips.uni-bremen.de>
?attach
or ?with
Hope this helps,
baptiste
On 26 Sep 2008, at 14:57, Stefan Fritsch wrote:
> Dear R Users,
>
> another problem for me is the output of a function.
>
> I have several output variables which I give back with the list
> command.
>
> test <- function {return(list(a,b,c,d,e,f,g,...))}
>
> After the usage of the function I want to assign the variables to
> the output variables.
>
> result <- test()
>
> a <- result$a
> b <- result$b
> c <- result$c
> d <- result$d
> ...
>
> is there a more elegant way to assign these variables, without
> writing them all down?
>
> thank you very much for your help!
>
> Stefan Fritsch
>
> ______________________________________________
> R-help at 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.
_____________________________
Baptiste Augui?
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phone: +44 1392 264187
http://newton.ex.ac.uk/research/emag