if (FALSE) { # interactive()
# \donttest{
# Set data dir for file downloads
spod_set_data_dir(tempdir())
# basic example
# create a connection to the v1 data without converting
# this creates a duckdb database connection to CSV files
od_distr <- spod_get(
"od",
zones = "distr",
dates = c("2020-03-01", "2020-03-02")
)
# disconnect from the database connection
spod_disconnect(od_distr)
# Advanced example
# download and convert data
dates_1 <- c(start = "2020-02-17", end = "2020-02-19")
db_2 <- spod_convert(
type = "od",
zones = "distr",
dates = dates_1,
overwrite = TRUE
)
# now connect to the converted data
my_od_data_2 <- spod_connect(db_2)
# disconnect from the database
spod_disconnect(my_od_data_2)
# }
}
Run the code above in your browser using DataLab