You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require(data.table) # today's devel
(dt<- data.table(my_col= Sys.time()))
# my_col# 1: 2020-01-31 19:43:48
fwrite(dt, file=tmp<-tempfile(), quote=TRUE, dateTimeAs="write.csv")
readLines(tmp)
# [1] "\"my_col\"" "\"2020-01-31 19:43:48\""
fread(tmp)
# V1 "my_col"# 1: "2020-01-31 19:43:48"# Warning messages:# 1: In fread("~/Downloads/tmp.csv") :# Found and resolved improper quoting in first 100 rows. If the fields are not quoted (e.g. field separator does not appear within any field), try quote="" to avoid this warning.# 2: In fread("~/Downloads/tmp.csv") :# Detected 1 column names but the data has 2 columns (i.e. invalid file). Added 1 extra default column name for the first column which is guessed to be row names or an index. Use setnames() afterwards if this guess is not correct, or fix the file write command that created the file to create a valid file.
Activity
MichaelChirico commentedon Jan 31, 2020
related: #3509
MichaelChirico commentedon Nov 9, 2026
Closed by #7370