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

From: Ben Bolker <>
Date: Tue, 18 Nov 2008 22:01:49 +0000 (UTC)

Nicklas Pettersson <Nicklas.Pettersson <at>> writes:

> 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=""))

  I think this is FAQ 7.21, "how can I turn a string into a variable":

    Ben Bolker mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 18 Nov 2008 - 22:05:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 18 Nov 2008 - 22:30:32 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive