The goal of dlr is to provide a friendly wrapper around the common pattern of downloading a file if that file does not already exist locally. We also allow for related file-processing tasks, such as processing a local file once into the format you’ll need in the future.
You can install the released version of dlr from CRAN with:
install.packages("dlr")
And the development version from GitHub with:
# install.packages("devtools")
::install_github("macmillancontentscience/dlr") devtools
This package is intended primarily to be used in other packages. For example, you might have a function in your package like this.
<- function() {
get_foo # Use dlr to find the cache path. If the file isn't already downloaded, dlr
# will download it, process it, and save it as an RDS.
return(
::read_or_cache(
dlrsource_path = "https://fake.fake/foo.csv",
appname = "myCoolPackage",
process_f = read.csv
)
) }
Please note that the dlr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
This is not an officially supported Macmillan Learning product.
Questions or comments should be directed to Jonathan Bratt (jonathan.bratt@macmillan.com) and Jon Harmon (jonthegeek@gmail.com).