Parses a .dvc pointer file and downloads the corresponding data file from
the public Cloudflare R2 remote.
Arguments
- x
Path to a
.dvcpointer file.- output_dir
Directory to write the downloaded file into.
- overwrite
Logical. If
FALSE, skip if the file already exists with the expected md5. An existing file with a mismatching md5 (e.g. from an interrupted download) is always re-downloaded.- pkg_nm
Package name, used to point to the Cloudflare R2 bucket of interest.
Examples
x <- system.file("extdata/dvc-example/sampleA.tool1.table1.tsv.dvc", package = "nemo")
output_dir <- file.path(tempdir(), "dvc_single_test")
result <- dvc_download_file(x, output_dir)
result_cached <- dvc_download_file(x, output_dir, overwrite = FALSE)
# a corrupted local copy gets replaced
writeLines("truncated", result)
result_fixed <- suppressWarnings(dvc_download_file(x, output_dir, overwrite = FALSE))
