`fwrite(dateTimeAs = "write.csv")` is not aligned with `write.csv()`
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 45/100
Direção de pesquisa
Start by reproducing the minimal example with fwrite(dateTimeAs = "write.csv"), write.csv(), and options("digits.secs"). Then locate the existing fwrite dateTimeAs coverage and determine how timestamp precision is selected; done means fwrite preserves the millisecond portion by default in the same way as write.csv, with regression coverage.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I just tried to replace some write.csv calls with fwrite using its dateTimeAs = "write.csv" option and noticed that by default (without setting digits.secs) fwrite removes the millisecond portion from the timestamps, which is not (or no longer) the case when using write.csv.
The background was discussed here. However, it seems only a corresponding test was adapted and fwrite was not aligned with write.csv.
Is this intentional? I think it's confusing.
Minimal reproducible example
library(data.table)
options("digits.secs")
# options(digits.secs = 3L)
DT <- data.table(TS = as.POSIXct("2026-02-26 13:21:49.123"))
write.csv(DT, file = "write.csv", quote = FALSE, row.names = FALSE)
readLines("write.csv")
# [1] "TS" "2026-02-26 13:21:49.123"
fwrite(DT, file = "fwrite.csv", dateTimeAs = "write.csv")
readLines("fwrite.csv")
# [1] "TS" "2026-02-26 13:21:49"
sessionInfo()
R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
time zone: Europe/Berlin
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.18.2.1
loaded via a namespace (and not attached):
[1] compiler_4.5.2 cli_3.6.5 tools_4.5.2 rstudioapi_0.18.0 pkgload_1.5.0
[6] rlang_1.1.7
- Linguagem predominante
- R
- Estrelas
- 3.9k
- Forks
- 1.1k
- Merge médio
- 15h 51min
- PRs com merge (30d)
- 3
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Rdatatable/data.table
-
as.data.table() recurses without end on a survival::Surv object (or any data.frame carrying one)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Rdatatable/data.table#7887 ·
-
test() doesn't distinguish plain NA_real_, NaNTalvez já em andamento @MichaelChirico assumiu há 68 dias. Abertaconsistency tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Rdatatable/data.table#7853 · 3 comentários ·
-
HAVE_LONG_DOUBLE is conditioned on but never setTalvez já em andamento @venom1204 assumiu há 512 dias. Abertainternals
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Rdatatable/data.table#6938 · 1 comentário ·
-
encoding fread
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Rdatatable/data.table#5179 · 8 comentários ·
-
documentation programming
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Rdatatable/data.table#3199 · 3 comentários ·
Todas as issues de Rdatatable/data.table
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
hubverse-org/hubUtils#317 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Rapporteket/NORIC#318 ·
-
Installed vignettes show blank tables/plots: self_contained: no drops lt assets on R CMD buildAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100