Access data stored online.
download_data(x, destfile = NULL)
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 |
A dataset.
Other datasets: datasets
,
example_path
# Not running CRAN checks (may take longer than the allowed run time limit) # \donttest{ # Defaults to read data # The first call is memoised system.time(download_data("unique_id"))#> user system elapsed #> 0.015 0.003 0.203#> user system elapsed #> 0 0 0download_data("unique_id")#> # A tibble: 3 x 2 #> table column #> <chr> <chr> #> 1 tree TreeID #> 2 stem StemID #> 3 ViewFullTable DBHID# Can download data to a destination file given by `destfile` tmp <- tempfile() download_data("unique_id", destfile = tmp) load(tmp) unique_id#> # A tibble: 3 x 2 #> table column #> <chr> <chr> #> 1 tree TreeID #> 2 stem StemID #> 3 ViewFullTable DBHIDavailable_data <- "https://github.com/forestgeo/fgeo.data/tree/master/data" if (interactive()) browseURL(available_data) # }