see ?assign and ?get i,e instead ob <blank> below have something like assign(paste("v", i, sep=""), a[i:N]) and if you need to loop over calling them say get(paste("v", i, sep=""))
of course typing v1 will call the variable... Jean On Tue, 30 Nov 2004, Tobias Muhlhofer wrote: > I am trying to define a large number of variables through a loop construct. > > I have my loop variable i being cycled through 1:100 and I would like > the variables produced by this to be called > > vi (i.e. v1 v2 v3 etc) > > so, for example I'm going: > > for(i in 1:100) { > > <blank> <- a[i:N] # or whatever else you want to put on the right side > > > } > > where N is previously defined. > > What goes in for <blank>? > > Thanks, > Toby > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html