1

I'm using the rtweets library (search_tweets function) to retrieve data from twitter. All data is present except location data, for which I just get "NA". What's even weirder is occasionally I do get coordinates (but very infrequently).

search_tweets("coronavirus", n = 1000, include_rts = FALSE, lang="en")

This is what I get for the coords_coords variable (just showing a random section here to highlight how I sometimes get a value). Thanks in advance for your help!

[[917]] [1] NA NA

[[918]] [1] NA NA

[[919]] [1] NA NA

[[920]] [1] NA NA

[[921]] [1] 43.77429 -79.71640

[[922]] [1] NA NA

[[923]] [1] NA NA

1 Answers1

1

From Tweet location FAQs:

This feature is off by default and you will need to opt in to use it.

Since you get location data occasionally, I'd say it is likely that most of the data simply doesn't have this info.

Benjamin Schwetz
  • 624
  • 5
  • 17
  • Only a tiny proportion of Tweets have geolocation associated. – Andy Piper Feb 05 '20 at 15:51
  • Oh that's a shame. I was hoping to produce maps using ggplot showing location and sentiment for different tweets. Guess I'll manage with the data that is available. Thanks! – Parth Kapur Feb 07 '20 at 04:58