-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Milestone
Description
keepLeadingZeros seems to interfere with automatic date recognition. The date is recognized as such only when keepLeadingZeros=FALSE. If this is by design I couldn't find it documented.
Compare the output of the these two lines:
str(fread("date, id\n2020-01-05, 00001\n2020-01-10, 00003", keepLeadingZeros = TRUE ))
Classes ‘data.table’ and 'data.frame': 2 obs. of 2 variables:
$ date: chr "2020-01-05" "2020-01-10"
$ id : chr "00001" "00003"
- attr(*, ".internal.selfref")=<externalptr>
str(fread("date, id\n2020-01-05, 00001\n2020-01-10, 00003", keepLeadingZeros = FALSE))
Classes ‘data.table’ and 'data.frame': 2 obs. of 2 variables:
$ date: IDate, format: "2020-01-05" "2020-01-10"
$ id : int 1 3
- attr(*, ".internal.selfref")=<externalptr>
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.13.6
loaded via a namespace (and not attached):
[1] compiler_4.0.3 tools_4.0.3 yaml_2.2.1
r2evans, KyleHaynes and rasmusrhl