download_data: Access data stored online.

Description Usage Arguments Value See Also Examples

Description

Access data stored online.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Not running CRAN checks (may take longer than the allowed run time limit)

# 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)

fgeo.x documentation built on June 8, 2019, 1:04 a.m.