Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

Error with "arguments imply differing number of rows" when using network_data() after get_timeline() #730

@d-schafer

Description

@d-schafer

Problem

I'm using get_timeline() and then network_data() in a for loop to request user data and then pull out the network data. The code looks like this (in the example, I include a user_id that produces the error):

for (i in list_userids) { 
     twt <- rtweet::get_timeline(
      user = 1016593091480948736,
      n = 500,
      retryonratelimit = TRUE
    )
    #extracting network data
    net <- network_data(twt, e = "all")
    #row binding net data
    net_all <- rbind(net_all, net)
}

The error occurs when running network_data() :

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

Expected behavior

The for loop works, but the row error occurs in 1 out of every 5 or so loops. The list_userids contains around 800 ids, and the error occurred around 160 times.

The error doesn't occur at the same row number. For example, when running the same get_timeline() and network_data() loop using user id 231751795, the resulting error gives: arguments imply differing number of rows: 334, 335, 1

rtweet version

I am using rtweet version: 1.0.2
R version: 4.2.1
R studio: 2022.07.1 Build 554

Please let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions