[R] Loop for readLines(URL[i]) fails when URL returns Error 404

Shelby McIntyre smcintyremobile at me.com
Wed Aug 22 20:28:06 CEST 2012


I have a loop over readLines(URL[i]) which works fine until it hits a bad URL (e.g., a
URL that returns a 404 Error).

How can I handle this with a test for this error condition.

I read the tryCatch( … ) description but can't figure out how to apply it here. Perhaps
there is something else that would work better.


More information about the R-help mailing list