Re: [R] Naming dataframes, vectors etc within a loop

2008-08-12 Thread jim holtman
First consider using a list: test <- list() for (i in 1:10) test[[i]] <- i If you really want to create variables, then look at "assign" for (i in 1:10) assign(paste("test.", i, sep=""), i) On Tue, Aug 12, 2008 at 7:49 PM, Gareth Campbell <[EMAIL PROTECTED]> wrote: > Hi there, > > I know this i

Re: [R] Naming dataframes, vectors etc within a loop

2008-08-12 Thread Henrik Bengtsson
See help(list) and help("[[") ...and 'An Introduction to R'. /Henrik On Tue, Aug 12, 2008 at 7:49 PM, Gareth Campbell <[EMAIL PROTECTED]> wrote: > Hi there, > > I know this is probably a really simple question, but without the correct > keywords, or knowledge of the correct function it is hard to

[R] Naming dataframes, vectors etc within a loop

2008-08-12 Thread Gareth Campbell
Hi there, I know this is probably a really simple question, but without the correct keywords, or knowledge of the correct function it is hard to search for on the net or within R. How do I increment a dataframe (or similar) name within a loop and assign data? A simple example would be: for(i in