I have data frame as csv file, numbers are separated with commas as decimal separators, I managed to import and read it in R using read.csv2
. But now numbers are seen as characters
.
What I want to do is to replace commas with dots and have a numeric
value.
My df looks like this:
var1 <- c("50,0", "72,0", "960,0", "1.920,0", "50,0", "50,0", "960,0")
var2 <- c("40,0", "742,0", "9460,0", "1.920,0", "50,0", "50,0", "960,0")
var3<- c("40,0", "72,0", "90,0", "1,30", "50,0", "50,0", "960,0")
df <- data.frame(cbind(var1, var2, var3))
However in this case numbers are seen as factors and not as characters