Ignore error when importing JSON files in R
问题 I have this for loop that download a json file from a solr search server. It loops over a vector that contain keywords (100, in this case): library(jsonlite) for (i in 1:100) { docs <- fromJSON(paste("http://myurl.com/solr/select?df=topic&fq=",keywords[i],"&indent=on&q=*:*&rows=1&wt=json",sep="")) numFound <- docs$response$numFound print(numFound) } It works fine, until it reaches a certain keyword that is not found on the solr, and returns this error: Error in open.connection(con, "rb") :