4
I have a csv file, saved via Excel (using ";" as column separator). When I import it into the R the numbers that are in the 0.00 format are as factor and comma.
Ex: "123,45"
When making the conversion it becomes text.
num <- gsub("," , "." , "123,45")
num = "123.45"
when I convert them individually they turn number.
num <- as.numeric(num)
num = 123.45
But when I do it in an array, the numbers are rounded.
numeros <- gsub(",",".",numeros)
numeros <- as.numeric(numeros)
numbers = 123 457 ...
Even using a loop the same thing happens.
for (i in 1:lenght(numeros)) {
numeros[i] <- as.numeric(numeros[i]
}
numbers = 123 457 ...
I wonder how numbers with comma numbers in numbers in the R pattern.