Download and Cache Files Safely

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.


dlr

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.

Installation

You can install the released version of dlr from CRAN with:

install.packages("dlr")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("macmillancontentscience/dlr")

Example

This package is intended primarily to be used in other packages. For example, you might have a function in your package like this.

get_foo <- function() {
  # 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(
    dlr::read_or_cache(
      source_path = "https://fake.fake/foo.csv",
      appname = "myCoolPackage",
      process_f = read.csv
    )
  )
}

Code of Conduct

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.

Disclaimer

This is not an officially supported Macmillan Learning product.

Contact information

Questions or comments should be directed to Jonathan Bratt ([email protected]) and Jon Harmon ([email protected]).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("dlr")

1.0.1 by Jon Harmon, 5 years ago


https://github.com/macmillancontentscience/dlr


Report a bug at https://github.com/macmillancontentscience/dlr/issues


Browse source code at https://github.com/cran/dlr


Authors: Jonathan Bratt [aut] , Jon Harmon [aut, cre] , Bedford Freeman & Worth Pub Grp LLC DBA Macmillan Learning [cph, fnd]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports digest, fs, rappdirs, rlang, utils

Suggests knitr, rmarkdown, testthat


Imported by morphemepiece, wordpiece.


See at CRAN