Pj_ Pj_ - 1 year ago 74
R Question

Extracting tweets with Retweet data using filterStream()

I am trying to extract tweets using certain keywords.

My code is:

filterStream(file.name = "tweets.json", track = c('fun', 'arbitrary'),
langauge = 'en', timeout = 1200, oauth = my_oauth)

The problem is that it doesn't returns retweets. I have been looking around a possible solution on the internet, but couldn't find it.

The official documentation talks about the following, but doesn't mentions how to set
to retrieve retweet data as well:

file.name = NULL, track = NULL, follow = NULL, locations = NULL, language = NULL, timeout = 0, tweets = NULL, oauth = NULL, verbose = TRUE

Is there something I am missing?

Pj_ Pj_
Answer Source

The main confusion behind this was question was because when I checked retweeted column my resulting data, it always showed this:

> head(t16.df$retweeted, 10)

Whereas, when I checked my text column, it did indeed contained retweets.

> head(t16.df$text)
[1] "It's hard, but here's how to support innovation via @HarvardBiz  #innovation #startup #create "      
[2] "Do you want to work for someone else your entire life ? #startup #success #entrepreneur #business #inspiration"            
[3] "RT @StartGrowthHack: How to start a #startup? What is the process to make it a #success. #Entrepreneur "                    
[4] "RT @ipfconline1: #Startup: Outbound #Marketing vs #InboundMarketing >> The Best Is to Use a Mix of Both #GrowthHack…"
[5] "Understanding and using marke #FolaDanielSpeaks Call +2348034163006 to Book Fola Daniel to speak, train or compere"        
[6] "RT GrowthHackers: The Process of Creating Trello #startup  -via biconnections"  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download