ropensci-archive / rtweet

🐦 R client for interacting with Twitter's [stream and REST] APIs
https://docs.ropensci.org/rtweet
Other
786 stars 201 forks source link

network_graph: arguments imply differing number of rows error #743

Closed mancebral closed 1 year ago

mancebral commented 2 years ago

Problem

When I use network_graph() over a rtweet object, the one obtained with the function search_tweets(), I get the error:

Error in data.frame(from = um$id_str, to = ur$id_str, type = "retweet") : arguments imply differing number of rows: 3982, 3988, 1

Expected behavior

It doesn't happen always, it depends of the number of tweets searched, and the query. I suppose that it is motivated by some column that is not parsing well the lists, but I don't know how to fix it, and I understand that is a problem of the function itself.

Reproduce the problem

## insert code here
wHashtags <- search_tweets("#whatsapp", 10000)

wNetworkGraph <- network_graph (wHashtags, 
                                 e = c("mention", "retweet", "reply", "quote"))

rtweet version

[1] ‘1.0.2’

Session info

R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

llrs commented 2 years ago

Thank you very much for your detailed report!

This issue might be related to #730, where accounts deleted caused problems with network_data. I fixed this in the devel version of the package (available at the devel branch) in case you want to test if it fixes the problems.

However, as you noted this might be hard to reproduce and without it I cannot fix the issue. If you find the error again, please store the tweets causing the error and upload them here (or send them to me via email) so that I can explore the problem and fix it.

llrs commented 1 year ago

Closing as I think this was fixed, but if not please reopen again or open a new issue.