search_tweets() with results < n

15 views
Skip to first unread message

urs.m...@gmail.com

unread,
Nov 6, 2017, 12:36:56 PM11/6/17
to rtweet
Hi

Thanks for the rtweet package, I really like working with it.

My question: If the number of available tweets (according to the search string q) is less than n, search_tweets will deliver a list instead of a df and the following code won't work properly. Theres no warning. 
Is there a good way to deal with that?


Example

search_tweets(q = "...", n = 300) finds 245 Tweets related to q.
The result will be a list with 246 entries and the 246th elements = NA. I would expect a dataframe with 245 entries.

mike.wayn...@gmail.com

unread,
Nov 6, 2017, 6:07:20 PM11/6/17
to rtweet
This has been fixed in the newest [Github] version of rtweet. You can install it using the following code:

``` r
## install devtools package if it's not already
if (!"devtools" %in% installed.packages()) {
  install.packages("devtools")
}

## install dev version of rtweet from github
devtools::install_github("mkearney/rtweet")

## load rtweet package
library(rtweet)

```

urs.m...@gmail.com

unread,
Nov 7, 2017, 2:07:32 AM11/7/17
to rtweet
Great, thx!
Reply all
Reply to author
Forward
0 new messages