[R] Not able to convert data.frame to numeric properly
Sachinthaka Abeywardana
sachin.abeywardana at gmail.com
Wed Apr 9 08:11:26 CEST 2014
I have the following:
>a #note that the 28 is a row.name
GHP GP T Tn
28 2.2194 2.6561 2.9007 3.2988
>min(as.numeric(a))
2.9007
>min(as.numeric(as.character(a)))
2.9007
>as.numeric(as.character(a)) #What's going on here???
[1] 33.0000 29.0000 2.9007 3.2988
So basically how do I get this to show the correct value of 2.21 as my
minimum value?
Thanks,
Sachin
More information about the R-help
mailing list