2

I have a weblink to get some test data which is in the form of a .csv file (European). I've tried using the following command:

dat <- fread(file_link, sep = ";", dec = ",")

Where file_link is the weblink - since it can not be accessed from outside the private network, here is a sample https://drive.google.com/file/d/0BwghuckSBss7ZmtEMXBYMGNSOWs/view?usp=sharing

The data.tables shows the different observations as chr:

> str(dat)
Classes ‘data.table’ and 'data.frame':  377 obs. of  7 variables:
 $ tme  : chr  "2017-10-01 21:00:00" "2017-10-01 21:01:00" "2017-10-01 21:02:01" "2017-10-01 21:03:00" ...
 $ degc : chr  "24,95" "24,95" "24,99" "24,99" ...
 $ rh   : chr  "27,005" "27,005" "26,903" "26,903" ...
 $ pres : int  100775 100775 100778 100778 100766 100766 100769 100769 100768 100768 ...
 $ pm1  : chr  "892,87" "886,565" "874,689" "876,735" ...
 $ pm2.5: chr  "1761,31" "1744,13" "1720,47" "1724,42" ...
 $ pm10 : chr  "1994,24" "1974,4" "1935,62" "1944,31" ...
 - attr(*, ".internal.selfref")=<externalptr> 

I have seen the question posted here (decimal point setting in fread, data.table) but it doesn't appear to be working in my case. Some additional details:

> options()$datatable.fread.dec.locale
[1] "fr_FR.utf8"


> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.6

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rio_0.5.5         reshape2_1.4.2    lubridate_1.6.0   stringr_1.2.0     ggplot2_2.2.1    
[6] data.table_1.10.4 dplyr_0.7.4      

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13     bindr_0.1        magrittr_1.5     munsell_0.4.3    colorspace_1.3-2
 [6] R6_2.2.2         rlang_0.1.2      plyr_1.8.4       tools_3.3.3      grid_3.3.3      
[11] gtable_0.2.0     readxl_1.0.0     lazyeval_0.2.0   assertthat_0.2.0 tibble_1.3.4    
[16] bindrcpp_0.2     curl_3.0         glue_1.1.1       haven_1.1.0      labeling_0.3    
[21] openxlsx_4.0.17  stringi_1.1.5    cellranger_1.1.0 forcats_0.2.0    scales_0.5.0    
[26] foreign_0.8-69   pkgconfig_2.0.1 
Gautam
  • 2,597
  • 1
  • 28
  • 51
  • Did you check [NEWS](https://github.com/Rdatatable/data.table/blob/master/NEWS.md) ? – Matt Dowle Oct 09 '17 at 07:10
  • @MattDowle In this case, just to confirm, you would suggest installing from Git as described in this installation [link](https://github.com/Rdatatable/data.table/wiki/Installation) ? – steveb Oct 09 '17 at 14:51
  • 1
    @steveb Yes, if you're on Mac. Or for Windows users, a binary .zip is pre-built for you so you don't need any tools. Alternatively, askers can ask for workarounds with the released version if they make it clear they've read the NEWS file. – Matt Dowle Oct 09 '17 at 17:24
  • @MattDowle I tried installing version 1.10.5 from the link that steveb posted but the installation fails.Tried following the other links but that failed too. It is rather complicated and I'm new to MacOS. Might just revert to old data.table and clean up data using regular expressions. – Gautam Oct 09 '17 at 19:08
  • @Marwaha Try pasting whatever error message you saw (the full long message) into Google - works surprisingly well. But, understood. I rarely use MacOS so I don't really know. For whatever reason MacOS seems to give us the most trouble. We don't see the same issues on Windows or Linux, in this project at least. – Matt Dowle Oct 09 '17 at 22:45

0 Answers0