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.

Reply via email to