All I have this code #=============== Function Downloads the Factor File #' A function to download FNMA Pool Factors #' #' @importFrom httr GET #' @importFrom httr write_disk #' @importFrom httr http_status #' @importFrom httr progress #' @export FNMAPoolFactor <- function(){ Year <- format(Sys.Date(), "%Y") Month <- format(Sys.Date(), "%m") response <- httr::GET( paste("https://mbsdisclosure.fanniemae.com/disclosure-docs/monthly/", "mbs", as.character(Month), as.character(Year), ".zip", sep = ""), httr::write_disk(paste("~/FNMA/mbs/", as.character(Month), as.character(Year), ".zip", sep = ""), overwrite = FALSE), httr::progress()) httr::http_status(response) }
Which results in a zip file but I cannot open the file with unzip or any other R functions what have I done wrong? Glenn ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.