Its simple question but looks like it doesn't exist in the stackoverflow
I have a data frame where all columns are factors I want to convert it to decimals.
Var1 Var2 Var3 Var4
1 0.76 0.84 0.76 0.73
2 0.76 0.84 0.76 0.73
3 0.76 0.84 0.76 0.73
4 0.76 0.84 0.76 0.73
5 0.76 0.84 0.76 0.73
6 0.76 0.84 0.76 0.73
I want to convert this without loosing the decimals.
df <- sapply(df, as.numeric)
This doesn't retain the decimals.