[R] Help on creating a sequence of vectors

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Mon Jun 22 12:01:54 CEST 2009


megh:
> I want to create a number of  vectors like :
> 
> vec1 <- rnorm(1)
> vec2 <- rnorm(2)
> vec3 <- rnorm(3)
> 
> and so on...........


Maybe try the assign() function. Something like:

for (i in 1:10)	assign ( paste ( "vec" , i , sep = "" ) , rnorm(i) )

Kind regards, Nikos




More information about the R-help mailing list