I would like to use fread from data.table, but I get a warning associated with the decimal point [here a ',' instead of '.']. I usually use ".", But in some cases for a file I need to import files with "," as a decimal point.
In read.csv, I can set the decimal point separator:
df <- read.csv("mydata.csv", sep=";", dec=",")
How to do this in the fread function in data.table? with
df=fread('mydata.csv',sep=';')
A warning message appears:
Warning message: In fread("mydata.csv", : Bumped column 7 to type character on data row 86, field contains '4,5'.
where 4,5 is the value that would be correctly read as "4.5" with sep = ',' in read.csv.
sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 [6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
source share