write table in database with dplyr
问题 Is there a way to make dplyr hooked up to a database pipe data to a new table within that database, never downloading the data locally? I'd like to do something along the lines of: tbl(con, "mytable") %>% group_by(dt) %>% tally() %>% write_to(name = "mytable_2", schema = "transformed") 回答1: While I whole heartedly agree with the suggestion to learn SQL, you can take advantage of the fact that dplyr doesn't pull data until it absolutely has to and build the query using dplyr , add the TO TABLE