View source: R/duckdb-helpers.R
spod_duckdb_number_of_trips | R Documentation |
This function creates a duckdb connection to the number of trips data stored in a folder of CSV.gz files.
spod_duckdb_number_of_trips(
con = DBI::dbConnect(duckdb::duckdb(), dbdir = ":memory:", read_only = FALSE),
zones = c("districts", "dist", "distr", "distritos", "municipalities", "muni",
"municip", "municipios", "lua", "large_urban_areas", "gau", "grandes_areas_urbanas"),
ver = NULL,
data_dir = spod_get_data_dir()
)
con |
A duckdb connection object. If not specified, a new in-memory connection will be created. |
zones |
The zones for which to download the data. Can be |
ver |
Integer. Can be 1 or 2. The version of the data to use. v1 spans 2020-2021, v2 covers 2022 and onwards. |
data_dir |
The directory where the data is stored. Defaults to the value returned by |
A duckdb
connection object with 2 views:
od_csv_raw
- a raw table view of all cached CSV files with the origin-destination data that has been previously cached in $SPANISH_OD_DATA_DIR
od_csv_clean
- a cleaned-up table view of od_csv_raw
with column names and values translated and mapped to English. This still includes all cached data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.