fgeo.x (version 1.1.4)

download_data: Access data stored online.

Description

Access data stored online.

Usage

download_data(x, destfile = NULL)

Arguments

x

A string giving the name of the dataset to download. The name of any dataset listed here (without the extension).

destfile

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

Value

A dataset.

See Also

utils::download.file()

Other datasets: datasets, example_path

Examples

Run this code
# NOT RUN {
# Not running CRAN checks (may take longer than the allowed run time limit)
# }
# NOT RUN {
# Defaults to read data
# The first call is memoised
system.time(download_data("unique_id"))
# Subsequent calls use the memoised data, so takes no time
system.time(download_data("unique_id"))

download_data("unique_id")

# Can download data to a destination file given by `destfile`
tmp <- tempfile()
download_data("unique_id", destfile = tmp)
load(tmp)
unique_id

available_data <- "https://github.com/forestgeo/fgeo.data/tree/master/data"
if (interactive()) browseURL(available_data)
# }

Run the code above in your browser using DataLab