[R] Find the empty element in a factor array

Wendy wendy2.qiao at gmail.com
Wed Jan 26 22:58:31 CET 2011


Hi all,

I have a factor array, and some of the elements are empty. How would I
return the index number of the empty elements. For example,

test<-factor(c('A','','B','C','E'))
> test
[1] A   B C E
Levels:  A B C E

I would like the result equal to 2.

Thank you,
Wendy
-- 
View this message in context: http://r.789695.n4.nabble.com/Find-the-empty-element-in-a-factor-array-tp3238894p3238894.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list