[R] changing factor to numbers without getting NAs

chalabi.elahe at yahoo.de chalabi.elahe at yahoo.de
Fri May 13 13:56:08 CEST 2016


Hi all,
I have a df which a part of this is:
 
   TSTMax     :int 213 228 227 281
   TSTMin     :int 149 167 158 176 
   TSTMean    :Factor w/94 levels "100,2" , "104,3" , ...
I want to change the TSTMean into numeric but by using as.numeric(as.character(df$TSTMean)) I get too many NAs.
Is there a way to change TSTMean into numeric without those NAs?
I want TSTMean to be at the end like:
 
   TSTMean  :int 100.2 104.3 .....
 
Thanks for any help
Elahe



More information about the R-help mailing list