The subject describes the issue fully. Below is a working example. Versions are:
- R 3.5.2 (on Ubuntu 16.04.5 LTS on x86_64),
- readr 1.3.1,
- magrittr 1.5,
- lubridate 1.7.4, and
- tibble 2.0.1.
library(tibble)
library(lubridate)
library(magrittr)
library(readr)
tbl = tribble(
~date, ~value,
ymd("2019-05-05"), 1
)
tbl # class(tbl$date[1]) = "Date"
tbl = tbl %>% write_csv("tmp.csv")
tbl # class(tbl$date[1]) = "character"
The subject describes the issue fully. Below is a working example. Versions are: