Learn R Programming

rdryad (version 0.3.0)

dryad_fetch: Download Dryad files

Description

Download Dryad files

Usage

dryad_fetch(url, destfile = NULL, ...)

Arguments

url

(character) One or more Dryad URL for a dataset.

destfile

(character) Destination file. If not given, we assign a file name based on URL provided.

...

Further args passed on to curl::curl_download()

Value

(character) path(s) to the file(s)

Details

This function is a thin wrapper around curl::curl_download() to get files to your machine only. We don't attempt to read/parse them

Examples

Run this code
# NOT RUN {
# Single file
x <- dryad_files('10.5061/dryad.1758')

## without specifying a destination file
dryad_fetch(url = x)

## specify a destination file
dryad_fetch(url = x, (f <- tempfile(fileext = ".csv")))

# Many files
x <- dryad_files(doi = '10.5061/dryad.60699')
res <- dryad_fetch(x)
head(read.delim(res[[1]], sep = ";"))
# }

Run the code above in your browser using DataLab