I'm reading a csv and I have a problem with American and European numerical formats. American have .
for decimals and European for thousands. This is the reading csv routine.
read.csv("data.csv",header=F,skip=4, sep=";", fileEncoding= "cp1252")
The thing is when I have a number finished with 0, without decimals.
> 2.100
[1] 2.1
Imagine also:
> 2.113
[1] 2.113
I substituted, .
for blank and I have an European number, but in the other case I have 21.
Also I tried some changes, but i have some digits with ,
and I tried to use decimal and it didn't work.
EDIT:
What arrive at df.
2.100 21.882,30
gsub("\.", "", number); gsub("\,", ".", number);
I make some transformations, after:
2.100 21882.30
R thinks it's a 2,1 but it was a 2100, the read.csv2 doesn't work.