Displaying 1 result from an estimated 1 matches for "casez".
Did you mean:
case
2004 Jan 30
3
looping over factors
How does one loop over factors? Perhaps this is a newbie question.
I tried:
> b
[1] caseX caseY caseZ
Levels: caseX caseY caseZ
> length(b)
[1] 3
>
> for (i in b) {
+ print (b == i) ;
+ print (i);
+ }
[1] FALSE FALSE FALSE
[1] 1
[1] FALSE FALSE FALSE
[1] 2
[1] FALSE FALSE FALSE
[1] 3
>
But that strangely doesn't work. I must protest
the implications of the above. i , as an it...