Skip to contents

You can view this vignette any time by running:

spanishoddata::spod_codebook(ver = 2)

Work-in-progress. Coming soon, please come back in a few weeks. For now, please consult the official documentation (Secretaría de Estado de Transportes, Movilidad y Agenda Urbana 2024). Some data is already available in the same way as v1 data, just use dates starting with 2022-01-01.

Set the data directory

Choose where spanishoddata should download (and convert) the data by setting the SPANISH_OD_DATA_DIR environment variable with the following command:

Sys.setenv(SPANISH_OD_DATA_DIR = "~/spanish_od_data")

The package will create this directory if it does not exist on the first run of any function that downloads the data.

Setting data directory for advanced users

To permanently set the directory for all projects, you can specify the data directory globally by setting the SPANISH_OD_DATA_DIR environment variable, e.g. with the following command:

usethis::edit_r_environ()
# Then set the data directory globally, by typing this line in the file:
SPANISH_OD_DATA_DIR = "~/spanish_od_data"

You can also set the data directory locally, just for the current project. Set the ‘envar’ in the working directory by editing .Renviron file in the root of the project:

file.edit(".Renviron")
Secretaría de Estado de Transportes, Movilidad y Agenda Urbana. 2024. Estudio de movilidad de viajeros de ámbito nacional aplicando la tecnología Big Data. Informe metodológico (Study of National Traveler mobility Using Big Data Technology. Methodological Report).” https://www.transportes.gob.es/ministerio/proyectos-singulares/estudio-de-movilidad-con-big-data.