> Hello, > > I would like to have variables whose name are var1, var2, ... > in a loop : > > for (i in 1:10) > { > var(i) <- i # where var(i) is var1, .... > }
how about: for (i in 1:10){ eval(parse(text=paste("var", i, "<-", i, sep=""))) } HTH, Bernhard > > Thanks in advance > > Philippe > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > ---------------------------------------------------------------------- If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help