>>>>> "Samuelson," == Samuelson, Frank* <Samuelson> writes:

    > How does one loop over factors? 

You can loop on the levels of your factor:

> b<-factor(c('caseX','caseY', 'caseZ', 'caseX'))
> b
[1] caseX caseY caseZ caseX
Levels: caseX caseY caseZ
> for ( i in levels(b) ) { print(i) }
[1] "caseX"
[1] "caseY"
[1] "caseZ"
> 


Mike

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to