export_with_safe_date.Rd
Exports tsibble to csv correctly
export_with_safe_date(x, file)
x | tibble or tsibble with date column |
---|---|
file | filename |
file exporting code
Exports tsibble to csv correctly The problem is that simple rio::export will transform monthly dates into strange integers.
x = ts(1:10, frequency = 12, start = c(2000, 1)) x_tsi = tsibble::as_tsibble(x) x_tsi = dplyr::rename(x_tsi, date = index) export_with_safe_date(x_tsi, paste0(tempdir(), "/data.csv"))#> [1] "/tmp/RtmpagsqaA/data.csv"