Re: [R] try / tryCatch for download.file( ) within a for loop when URL does not exist

2007-10-16 Thread Vishal Belsare
Jim, Thanks. Actually I just got it working a few minutes ago with: tryCatch({download.file(url, destfile = file, quiet = FALSE, mode = "wb")}, silent = FALSE, condition = function(err) { } ) but I like your suggestion better. I'll attempt to log the list of url's downloaded ok and those which e

Re: [R] try / tryCatch for download.file( ) within a for loop when URL does not exist

2007-10-16 Thread jim holtman
I think this is closer to what you want. You can determine what you want to do; this one just goes to the next iteration: date <- as.POSIXlt(as.Date("2007-10-15", "%Y-%m-%d")) for (i in 1:difftime(as.POSIXlt(as.Date("2007-10-15", "%Y-%m-%d")),"2007-10-01")) { if (date$wday != 0 & da

[R] try / tryCatch for download.file( ) within a for loop when URL does not exist

2007-10-16 Thread Vishal Belsare
I am trying to download a bunch of files from a server, for which I am using download.file( ) within a for loop. The script is working fine except until download.file hits a URL which has no file, at which point it exits. I want to change this behavior to simple log the failure and maintain state w