Current data frame (df)
V1 V2 V3
a aa 0.11 1.11
b bb 3.45 2.24
c cc 2.23 3.45
sapply(df, class)
V1 V2 V3
"factor" "factor" "factor"
I am trying to convert V2 and V3 to numeric and this is what I tried:
df$V2<- as.numeric(df$V2)
df$V3<- as.numeric(df$V3)
Then it became integers like 1 2 3.
I am wondering how can I convert factors to numeric form without changing the data