I currently have some code in an R package that unzips and reads in a CSV file. Reproducible example here:
url <- paste0("http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Momentum_Factor_CSV.zip") temp <- tempfile() download.file(url,temp,quiet=TRUE,mode="wb") data <- data.table::fread(unzip(file.path(temp)),fill=TRUE,skip=13)
This leaves a CSV file in my working directory. What is the best practice way to do this without leaving a CSV in the users directory? I've tried unzipping to a temp file but fread doesn't seem to like reading that in.