spod_check_files | R Documentation |
WARNING: The checks may fail for May 2022 data and for some 2025 data, as the remote cheksums that are used for checking the file consistency are incorrect. We are working on solving this in future updates, for now, kindly rely on the built-in file size checks of spod_download
, spod_get
, and spod_convert
. This function checks downloaded data files whether they are consistent with their checksums in Amazon S3 by computing ETag for each file. This involves computing MD5 for each part of the file and concatenating them and computing MD5 again on the resulting concatenated MD5s. This may take very long time if you check all files, so use with caution.
spod_check_files(
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,
data_dir = spod_get_data_dir(),
quiet = FALSE,
ignore_missing_dates = FALSE,
n_threads = 1
)
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:
|
data_dir |
The directory where the data is stored. Defaults to the value returned by |
quiet |
A |
ignore_missing_dates |
Logical. If |
n_threads |
Numeric. Number of threads to use for file verificaiton. Defaults to 1. When set to 2 or more threads, uses |
A tibble similar to the output of spod_available_data
, but with an extra column local_file_consistent
, where TRUE
indicates that the file cheksum matches the expected checksums in Amazon S3. Note: some v1 (2020-2021) files were not stored correctly on S3 and their ETag checksums are incorrectly reported by Amazon S3, so their true file sizes and ETag checksums were cached inside the spanishoddata
package.
spod_set_data_dir(tempdir())
spod_download(
type = "number_of_trips",
zones = "distr",
dates = "2020-03-14"
)
# now check the consistency
check_results <- spod_check_files(
type = "number_of_trips",
zones = "distr",
dates = "2020-03-14"
)
all(check_results$local_file_consistent)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.