search for: _csv

Displaying 2 results from an estimated 2 matches for "_csv".

Did you mean: _cs
2007 Oct 16
1
try / tryCatch for download.file( ) within a for loop when URL does not exist
...IXlt(as.Date("2007-10-15", "%Y-%m-%d")),"2007-10-01")) { if (date$wday != 0 & date$wday != 6) { datestr <- as.character(date, "%d%m%y") #make date character string ddmmyy url <- paste("http://www.bseindia.com/bhavcopy/eq",datestr,"_csv.zip",sep="") file <- paste("C:/",datestr,"_csv.zip",sep="") #options(show.error.messages = FALSE) #options(warn = -1) try(download.file(url, destfile = file, quiet = TRUE, mode = "wb"), finally = cat("OK:",url,\n)) date <-...
2007 Oct 15
1
String concatenation, File Path Handling to pass to download.file( ) [backslash in DOS paths]
...e(as.POSIXlt(Sys.Date()),"2007-10-01")) if (date$wday != 0 & date$wday != 6) #check whether weekday { datestr <- as.character(date, "%d%m%y") #make date character string ddmmyy url <- paste("http://www.bseindia.com/bhavcopy/eq",datestr,"_csv.zip",sep="") file <- paste("C:\\Program Files\\R\\R-2.5.0\\data"\",datestr,"_csv.zip",sep="") download.file(url, destfile = file, mode = "wb") zip.unpack(file, cat("C:\\Program Files\\R\\R-2.5.0\\data\\")) date <- date...