[R] Selecting rows regarding the frequency of a factor variable.

Ghislain Vieilledent ghislainv at gmail.com
Wed Jun 29 16:53:51 CEST 2005


Hi and sorry to disturb,

I'll try to be as clear as possible:
I want to select rows of a data frame called "Data2.Iso" regarding the 
frequency of a factor variable called "Variete" that I want ">=4".

I used function table to have the frequency:
 > FRAMEVARIETE<-as.data.frame(table(Data2.Iso$Variete))
Then I selected the modalities with a frequency >=4:
 > FRAMEVARIETE2<-FRAMEVARIETE[FRAMEVARIETE$Freq>=4,]
 > as.character(FRAMEVARIETE2[,"Variete"])

But then, how to select the rows with those modalities?
Does anyone can help me?

Thanks!

Ghislain.




More information about the R-help mailing list