>>>>> "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