[R] How do I generate multiple (similar) objects within R?

Nicklas Pettersson Nicklas.Pettersson at stat.su.se
Tue Nov 18 18:58:52 CET 2008


Hi,

I wonder if anyone knows how to generate a list of objects, e.g. ten 
vectors with names: vect1, vect2, ... , vect10.
My own idea was to use something like:

    for (i in 1:10)
    print(paste("vect", i,"<-NULL",sep=""))

but the result is:

"vect1<-NULL"
...
"vect10<-NULL"

and not

vect1<-NULL
...
vect10<-NULL

as I would like. Does anyone know?



More information about the R-help mailing list