write.csv() in dplyr chain
csv, dplyr, file-io, r
Solution
This appeared to work for me in version 0.2:
mtcars %>% filter(cyl == 4) %>% write.csv(.,file = "~/Desktop/piping.csv")
Problem
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 ```