userTimeline on a vector of user names - twitteR

88 views Asked by At

I am using the twitteR package to get some data from twitter and analyze it.

I have a vector of twitter user names:

user_vec <- c("barackobama", "time", "nytimesworld", "wsj", "wsjd")

I want to get each user's timeline.

user_timeline <- userTimeline("barackobama", 100)

Now instead of running this for each user, I would like to pass the function using sapply

sapply(paste(user_vec, collapse=""), userTimeline, 100)

When I run this, I get the error:

[1] "Not Found" Error in twInterfaceObj$doAPICall(cmd, params, method, ...) : Error: Not Found

I tried looping too:

for(i in user_vec) {
  userTimeline(paste(i, collapse = ""), 5)
}

Is there a way I can get the user timelines without and got the exact same error message. What am I doing wrong and is there a way I can get the user's timelines without having to run the same code over and over?

0

There are 0 answers