This vignette introduces the
aopdata is an R package to download
data from the Access to
Opportunities Project (AOP). The AOP is a research initiative led by
the Institute for Applied Economic Research (Ipea) with the aim to study
transport access to opportunities in Brazilian cities.
aopdata package brings annual
estimates of access to employment, health, education and social
protection services by transport mode at a fine spatial resolution for
the 20 largest cities in Brazil. The package also brings data on the
spatial distribution of population by sex, race, income and age, as well
as the distribution of jobs, schools, healthcare facilities and social
assistance reference centers.
Data for 2017, 2018 and 2019 are already available, and cover accessibility estimates by car and active transport modes (walking and cycling) for the 20 largest cities in the country, and by public transport for over 9 major cities. For more information on the AOP website.
You can install
aopdata from CRAN, or the development
version from GitHub.
The aopdata package includes five core functions.
read_population()- Download population data
read_landuse()- Download landuse data
read_access()- Download accessibility estimates
aopdata_dictionary()- Opens aopdata data dictionary on a web browser
read_grid()- Download the H3 hexagonal spatial grid
First, you need to load the package.
The dictionary of data columns is presented in the documentation of each function. However, you can also open the data dictionary on a web browser by running:
read_access() function downloads accessibility
estimates for a given
year. For the sake of convenience, this function will also
automatically download the population and land use data for the cities
selected. Note that accessibility estimates are available for peak and
off-peak periods for
You many also set the parameter
geometry = TRUE so that
functions return a spatial
sf object with the geometries of
the H3 spatial grid.
In case you are only interested in using the population and land use data generated by the Access to Opportunities Project, you can download these data sets separately. Please note that the population available comes from the latest Brazilian 2010 census, while land use data cna be downloaded for 2017, 2018 or 2019.
In case you would like to download only the H3 spatial grid of cities
in the AOP project, you can use the
h3_for <- read_grid(city = 'Fortaleza', showProgress = FALSE) head(h3_for) #> Simple feature collection with 6 features and 4 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -38.50828 ymin: -3.889301 xmax: -38.4983 ymax: -3.878958 #> Geodetic CRS: WGS 84 #> id_hex abbrev_muni name_muni code_muni #> 1 89801040323ffff for Fortaleza 2304400 #> 2 89801040327ffff for Fortaleza 2304400 #> 3 8980104032bffff for Fortaleza 2304400 #> 4 8980104032fffff for Fortaleza 2304400 #> 5 89801040333ffff for Fortaleza 2304400 #> 6 89801040337ffff for Fortaleza 2304400 #> geom #> 1 POLYGON ((-38.50232 -3.8858... #> 2 POLYGON ((-38.50527 -3.8840... #> 3 POLYGON ((-38.49932 -3.8841... #> 4 POLYGON ((-38.50227 -3.8824... #> 5 POLYGON ((-38.50237 -3.8893... #> 6 POLYGON ((-38.50532 -3.8875...
In all of the functions above, note that:
cityparameter can also be a 3-letter abbreviation of the city.
city = 'all':
The R package aopdata is developed by a team at the Institute for Applied Economic Research (Ipea), Brazil.
If you use this package in your own work, please cite it as one of the publications below:
Population and land use data