0

How to store tweets such that when imported, all the details and column formatting remains the same.

library(rtweet)
tw1 <- search_tweets("RStats", n = 10000)

Next week:

tw2 <- search_tweets("RStats", n = 10000)
tweets <- dplyr::bind_rows(tw1, tw2)
Masood Sadat
  • 1,247
  • 11
  • 18
  • I'd think since `rtweet::search_tweets` returns a `data.frame` that your method of binding previous data would work fine. Storing it (and supporting R restarts) would be as simple as `write.csv` or one of its variants (including in `readr` and `data.table`). (I don't have the package installed, though, so if there are attributes or it isn't truly a simple "frame", it would help to see the output here. Can you include the output from `dput(head(tw1,n=2))`? – r2evans Dec 04 '18 at 18:54
  • @r2evans, I run `dput(head(tw1,n=2))` but I can't post it here. When I save it using `write_csv()`, it returns `Error in stream_delim_(df, path, ...) : Don't know how to handle vector of type list.` – Masood Sadat Dec 04 '18 at 19:18
  • Maybe this could help: https://stackoverflow.com/questions/48024266/save-a-data-frame-with-list-columns-as-csv-file/50281576 – Gorka Aug 12 '19 at 22:06

0 Answers0