I've come across this problem before, but just wrote the export function outside of the chain. Is there a way to include a write.csv
statement within a dplyr
chain?
library(dplyr)
data_set %>%
filter(Date == Sys.Date() - 1 | Date == Sys.Date()) %>%
write.csv('data_set_twodays.csv', row.names = F) %>%
filter(Date = Sys.Date()) %>%
write.csv('data_set_today.csv', row.names = F)
NULL