Q: R - from JSON - invalid JSON input I am retrieving information on followers for some Twitter screen_name via a standard JSON request. I am navigating through collections of results using the cursor option:
reqURL=GET(sprintf("https://api.twitter.com/1.1/followers/list.json?cursor=%1.0f&screen_name=%s&count=200",nextPage, screen_name),
    config(token = twitter_token)) 
req <- content(reqURL, as = "text")
newTweets=fromJSON(req)

Everything works fine, but from time to time (>50 JSON requests) I receive the following error message:

Error in fromJSON(content, handler, default.size, depth,
  allowComments,  :    invalid JSON input

Afterwards, when re-running the code using exactly the same input parameters (nextPage and screen_name), it works fine again.
What could be the problem?
