Extract tweets statistics using rtweet package

Hello

Using rtweet package, I was able to find number of followers for a given user name. like ("Tarun"), but having difficulties in finding the number of tweets by the user ("Tarun").

Below is the logic I have used to get the number of followers for a user.

list=list()
for(i in 1:length(user)){
u<-lookup_users(user[i])
n_id<-get_followers(user[i],n=u$followers_count,retryonratelimit = TRUE)
n_tweet=lookup
list[i]<-nrow(as.data.frame(n_id))
}

Using tweets_data() function can we find the number of tweets by the user

u<-lookup_users("username")
n<-tweets_data(u)

Any suggestion will be helpful.
Thanks

We can extract number of tweets by user as below

usr_df <- lookup_users(users)
#Number of tweets
usr_df$statuses_count

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.