you can return a single object, so a list is what you want. you can
always break it apart after the return.
What is the problem you are trying to solve?
Sent from my iPhone.
On Feb 10, 2010, at 8:31, Arnaud Mosnier <a.mosn...@gmail.com> wrote:
Dear useRs,
I want to make a function that return several object (from a loop).
I know, I can put them in a list, then the function return the list,
but is it possible that it returns several independent object.
I used the assign function to create several object, it works when I
use it outside the function, but not inside.
Any suggestion ?
Here is a piece of code that do something similar to my situation.
testfunc <- function ( listobj, valueX) {
for (i in 1:length(listobj)) {
objtemp <- get (listobj[i])
objtemp <- objtemp * valueX
assign(paste(listobj[i], "_", valueX, sep=""), objtemp)
}
return (??????????????????????)
}
______________________________________________
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.
______________________________________________
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.