This is actually FAQ 7.21. As others have mentioned, the most important part of the Answer is that it is better to use a list instead.
What searching did you do before posting? Is there some way that the FAQ could be changed that would have made your searching turn up the FAQ answer? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of jiliguala > Sent: Sunday, June 12, 2011 10:18 AM > To: r-help@r-project.org > Subject: [R] automatically generate the output name of my "for" loops > > > Hello R users, > > I am new to R and am having difficulty with the output name of my "for" > loops. > > here is the problem: > > > for (i in c(1:100)) > { > the name of the groups <- which(k1$cluster==i) > } > > how can it automatically generate the name for 100 cluster? what should > i > put in the bold letter place. > > really thank you for helping me > > Daniel > > -- > View this message in context: > http://r.789695.n4.nabble.com/automatically-generate-the-output-name- > of-my-for-loops-tp3592160p3592160.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.