[R] Understanding tryCatch

From: steven mosher <moshersteven_at_gmail.com>
Date: Fri, 18 Mar 2011 12:04:41 -0700


I've read the help and the archives on tryCatch but I'm still stuggling trying to understand how it
works exactly and how I can use it to get the result I need.

I have a data.frame of urls which point to 11 .zip files. Basically I use RCurl to get the list of
files from a ftp and then reduce that directory dump to the 11 zip files I want to download.

Its easy enough to do that in a loop over the elements in data.frame.

The problem is that the site is very inconsistent. All 11 files will download, but I will get random
warnings that the size of some of the files does not match what was downloaded.
So at the end of the loop I may get 5 warnings about the file size not matching.
These files, when tried a second or third time, will eventually download properly.

What I want to do is record which files had this download warning.

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Mar 2011 - 19:12:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Mar 2011 - 19:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive