You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
If anyuser_id or screen_name does not return values for whatever reason; the response parsing inside get_friends throws an error and the function returns nothing, regardless of whether other user_ids were queried successfully. Issue #339 describes this problem, but the title suggests it's just an inconvenience for users of the function downstream, rather than the function itself failing unexpectedly. The function works correctly if parse = FALSE is set; but the default is TRUE.
Expected behavior
The default behaviour for get_friends should ignore user_ids whose query fails, and return query values for other user_ids. That seems to be the intention given that the function first returns a warning and only later throws an error.
Reproduce the problem
Below one example for a missing user (probably a deleted account) paired with another that allows collection. #339 contains other examples.
rtweet::get_friends(c("796572560821485568", "BarackObama"), token = tk)
Warning: 34 - Sorry, that page does not exist.
Warning: ^^ warning regarding user: 796572560821485568
1 friend networks collected!
Error: Must extract column with a single valid subscript.
x Subscript `grep("id$", names(x))[1]` can't be `NA`.
Run `rlang::last_error()` to see where the error occurred.
Students of mine are also having trouble with the get_friends() function. In particular, if one of the screen_names in the vectors is associated with an account that follows no other accounts (i.e., friends_count == 0), then the whole function crashes and does not return an object.
It doesn't seem to have been updated lately. A workaround with my students has been to download the user information via lookup_users() and then subset out the accounts for which friends_count is zero.
Problem
If any
user_id
orscreen_name
does not return values for whatever reason; the response parsing insideget_friends
throws an error and the function returns nothing, regardless of whether otheruser_ids
were queried successfully. Issue #339 describes this problem, but the title suggests it's just an inconvenience for users of the function downstream, rather than the function itself failing unexpectedly. The function works correctly ifparse = FALSE
is set; but the default isTRUE
.Expected behavior
The default behaviour for
get_friends
should ignoreuser_ids
whose query fails, and return query values for otheruser_ids
. That seems to be the intention given that the function first returns a warning and only later throws an error.Reproduce the problem
Below one example for a missing user (probably a deleted account) paired with another that allows collection. #339 contains other examples.
rtweet version
0.7.0
Session info
The text was updated successfully, but these errors were encountered: