View source: R/download_data.R
spod_download | R Documentation |
This function downloads the data files of the specified type, zones, dates and data version.
spod_download(
type = c("od", "origin-destination", "os", "overnight_stays", "nt", "number_of_trips"),
zones = c("districts", "dist", "distr", "distritos", "municipalities", "muni",
"municip", "municipios", "lua", "large_urban_areas", "gau", "grandes_areas_urbanas"),
dates = NULL,
max_download_size_gb = 1,
data_dir = spod_get_data_dir(),
quiet = FALSE,
return_local_file_paths = FALSE,
ignore_missing_dates = FALSE
)
type |
The type of data to download. Can be |
zones |
The zones for which to download the data. Can be |
dates |
A The possible values can be any of the following:
|
max_download_size_gb |
The maximum download size in gigabytes. Defaults to 1. |
data_dir |
The directory where the data is stored. Defaults to the value returned by |
quiet |
A |
return_local_file_paths |
Logical. If |
ignore_missing_dates |
Logical. If |
Nothing. If return_local_file_paths = TRUE
, a character
vector of the paths to the downloaded files.
# Set data dir for file downloads
spod_set_data_dir(tempdir())
# Download the number of trips on district level for the a date range in March 2020
spod_download(
type = "number_of_trips", zones = "districts",
dates = c(start = "2020-03-20", end = "2020-03-21")
)
# Download the number of trips on district level for select dates in 2020 and 2021
spod_download(
type = "number_of_trips", zones = "dist",
dates = c("2020-03-20", "2020-03-24", "2021-03-20", "2021-03-24")
)
# Download the number of trips on municipality level using regex for a date range in March 2020
# (the regex will capture the dates 2020-03-20 to 2020-03-24)
spod_download(
type = "number_of_trips", zones = "municip",
dates = "2020032[0-4]"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.