How to save Twitter data, downloaded in R, in Excel?

Asked

Viewed 77 times

2

I am using R to download public profile data on Twitter. The time of collection goes right, with the following code:

library(rtweet)

trump <- get_timelines("realDonaldTrump", n = 500)

The problem is that when I save to excel, the separation of the columns is all wrong (maybe because one of them contains the text of the post). I’ve tried using the function save (in CSV and TXT) and also "Writexls", in addition to "write.table" with separators other than the comma (";" and " t"), but nothing works. Does anyone know how to do this? In the R environment the table appears right.

Thank you!

1 answer

3


Try with writexl

install.packages('writexl')  

library(writexl)

write_xlsx(x = trump, path = 'trump.xlsx')
  • It worked, thank you very much!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.