-
Notifications
You must be signed in to change notification settings - Fork 200
Error in $<-.data.frame
(*tmp*
, "app", value = "package_rtweet") :
#177
Comments
@mmarttin: the warning message "Warning message: Rate limit exceeded - 88" is from Twitter; so you're using a correct and active Twitter token. It looks like you may have (a) hit the rate limit between searches and (b) had a search that yielded no results. What version of rtweet are you using? packageVersion("rtweet") I'd recommend installing the latest version from Github (though I just disabled a rate limit check last night, but I don't think that'd cause your issues). devtools::install_github("mkearney/rtweet") Also, given the number of search queries and the size of ## vector of search queries
search_queries <- c("rstats OR CRAN OR rstudio OR rstatistics",
"python OR pynum", "julialang OR juliastats")
## initialize output vector
data <- vector("list", length(search_queries))
## for loop with tryCatch (if search results in error, return an empty
## data frame rather than breaking everything
for (i in seq_along(data)) {
data[[i]] <- tryCatch(
search_tweets(
search_queries[i], n = 250000, retryonratelimit = TRUE,
include_rts = FALSE, geocode = "40.416775,-3.70379,100km"),
error = function(e) return(data.frame())
)
## sleep for 15 mins (bc of Twitter rate limits) between search queries
Sys.sleep(60 * 15)
} Are you having any issues with |
Oh, and for the record, what |
Thank you for your help! I’ll try this!
Från: Michael W. Kearney [mailto:[email protected]]
Skickat: den 9 februari 2018 17:52
Till: mkearney/rtweet <[email protected]>
Kopia: Matti Marttinen Larsson <[email protected]>; Mention <[email protected]>
Ämne: Re: [mkearney/rtweet] Error in `$<-.data.frame`(`*tmp*`, "app", value = "package_rtweet") : (#177)
Oh, and for the record, what tryCatch is doing in the code above is telling R that if there's a code-breaking error, to return an empty data frame instead of the error. This means R will proceed to the next iteration in the loop and when it's done you'll still have what data has been collected. Before you try this loop though, make sure you run some normal searches just to make sure things are working.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://github.com/mkearney/rtweet/issues/177#issuecomment-364490709>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AinWw2SmTk0DzX00AYbwp3mzXkvHmixyks5tTHengaJpZM4R_s32>.
|
Hi!
I'm quite new to using R and rtweet so, if possible, please respond in somewhat laymans terms... :-)
I'm trying to do an exhaustive search with almost 4100 different search queries (can't spell out all of them here so I just entered one in the example code below), which of course is a lot. So I have the following code that I'm trying to run:
Test_lapply = lapply( c('"search quiry"'), search_tweets, n = 250000, retryonratelimit = TRUE, include_rts = FALSE, geocode = "40.416775,-3.70379,100km")
However, I get the following error message:
Error in
$<-.data.frame(
tmp, "app", value = "package_rtweet") : replacement has 1 row, data has 0 In addition: Warning message: Rate limit exceeded - 88
I Googled the error and found the following issue tread: https://github.com/mkearney/rtweet/issues/141
However, I get an error message there (the one examplified in the tread) saying that I don't have an ".httr-oauth" file in my current working directory, so I'm not sure what to do.
Any kind of help would be very much appreciated.
The text was updated successfully, but these errors were encountered: