[R] subset data right

chalabi.elahe at yahoo.de chalabi.elahe at yahoo.de
Thu May 26 21:35:52 CEST 2016


Hi all,
I have the following df and I want to know which Protocols are VeryFast, which are FAST, which are SLOW and also which ones are VerySLOW :

    
  $ Protocol       : Factor w/ 48 levels "DP FS QTSE SAG",..: 5 5 28 5 5 5 7 7 47 5 ...

  $ quant          : Factor w/ 4 levels "FAST","SLOW",..: 2 2 2 4 2 1 1 2 4 

I do the following subset but nothing is changed in my df:


  subdf=subset(df,quant%in%c("VeryFast"))
  subdf$quant=factor(subdf$quant)
and when I get the str(df) again Protocol has 48 levels. Does anyone know how can I get these subsets right?
Thanks for any help!
Elahe



More information about the R-help mailing list