if (FALSE) { # interactive()
# download all years (uses tempdir to avoid leaving files)
df <- vigitel_data(cache_dir = tempdir())
# download specific year
df_2024 <- vigitel_data(year = 2024, cache_dir = tempdir())
# download multiple years
df_recent <- vigitel_data(year = 2020:2024, cache_dir = tempdir())
# select specific variables
df_subset <- vigitel_data(
year = 2024,
vars = c("ano", "cidade", "sexo", "idade", "pesorake"),
cache_dir = tempdir()
)
}
Run the code above in your browser using DataLab