## list all supported files
French()
# \donttest{
## fetch names of files from Kenneth French's website
try({
txt <- readLines(paste0("https://mba.tuck.dartmouth.edu/pages/",
"faculty/ken.french/data_library.html"))
csv <- txt[grep("ftp/.*CSV.zip", txt, ignore.case = TRUE)]
gsub(".*ftp/(.*?CSV.zip).*", "\1", csv, ignore.case = TRUE)
})
# }
if (FALSE) {
archive.dir <- "~/Downloads/French"
if (!dir.exists(archive.dir))
dir.create(archive.dir)
French(archive.dir, "F-F_Research_Data_Factors_CSV.zip")
}
Run the code above in your browser using DataLab