Learn R Programming

dataset (version 0.3.1)

dataset_download: Download data into a dataset

Description

A wrapper around dataset and an import function.

Usage

dataset_download(url, title, author, destfile, type = "csv", ...)

dataset_download_csv(url, title, author, destfile = NULL, ...)

Value

A dataset with the downloaded dataset.

Arguments

url

a character string (or longer vector for the "libcurl" method) naming the URL of a resource to be downloaded.

title

The title of the dataset.

author

A single person or a vector of persons as authors, declared with person.

destfile

a character string (or vector, see the url argument) with the file path where the downloaded file is to be saved. Tilde-expansion is performed.

type

A file type. Currently only csv is implemented that utils::download.file.

...

Various parameters to pass on to the downloading functions.

Examples

Run this code
# \donttest{
dest_file <- file.path(tempdir(), "iris.csv")
dataset_download(
   url = "https://zenodo.org/record/7421899/files/iris.csv?download=1",
   title = "Iris Dataset",
   author = person(given="Edgar", family="Anderson"),
   publisher = "American Iris Society",
   identifier = "https://doi.org/10.1111/j.1469-1809.1936.tb02137.x",
   destfile = dest_file)
# }

Run the code above in your browser using DataLab