Is there a way were I can determine the number of users_ids (in retweeters) that overlaps with the user_ids (in Followers)? Taking into consideration to compare user 1 in retweeters with user 1 in followers and so on. One way of doing that in R is through loops. Rtwts] <- search_tweets(x, n = 500)ĪA2 <- rbind.fill(lapply(AA, as.ame))īut this is combining all the users in one dataframe (but separating with with an extra column that identifies the user number, such as user 1, 2, 3. The goal of a function is often to make our life easier when repetitive and/or complex operations have to be done. If theres a function that will do what you want that can be vectorized you will almost always be better off using that instead. As for the 'second index dependent on first index' issue you can use i(), i() or indexing to achieve that too. # execute `i` loops (one for each obs in users)įlws] <- get_followers(users, n = "all", page = "-1", parse = TRUE, token = NULL) but if it is easier to develop with nexted loops, then do so.