You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The geobr package covers 27 spatial data sets, including a variety of political-administrative and statistical areas used in Brazil. You can view what data sets are available using the `list_geobr()` function.
The syntax of all *geobr* functions operate one the same logic, so the code to download the data becomes intuitive for the user. Here are a few examples.
74
68
75
69
Download an specific geographic area at a given year
@@ -187,7 +181,7 @@ The next step is to combine data from ***geobr*** package with other data sets
187
181
188
182
First, we need a `data.frame` with estimates of Life Expectancy and merge it to our spatial database. The two-digit abbreviation of state name is our key column to join these two databases.
Now we're going to (a) group observations by municipality, (b) get the number of households connected to a sewage network, (c) calculate the proportion of households connected, and (d) collect the results.
232
226
233
-
```{r,eval = use_suggested_pkgs, warning = FALSE}
227
+
```{r, warning = FALSE}
234
228
esg <- hs |>
235
229
collect() |>
236
230
group_by(code_muni) |> # (a)
@@ -243,7 +237,7 @@ head(esg)
243
237
```
244
238
Now we only need to download the geometries of Brazilian municipalities from **geobr**, merge the spatial data with our estimates and map the results.
0 commit comments