[R] automatically generate the output name of my "for" loops

Greg Snow Greg.Snow at imail.org
Tue Jun 14 23:43:34 CEST 2011


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.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of jiliguala
> Sent: Sunday, June 12, 2011 10:18 AM
> To: r-help at 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 at 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.



More information about the R-help mailing list