1
I read a file . shp with the package sf
.
map_recife = st_read("./shape/Bairros.shp", stringsAsFactors = FALSE)
> glimpse(map_recife)
Observations: 94
Variables: 11
$ CBAIRRCODI <dbl> 19, 27, 35, 43, 51, 60, 78, 86, 94, 108, 116, 124,...
$ VBAIRROID <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
$ EBAIRRNOME <chr> "RECIFE", "SANTO ANTONIO", "SAO JOSE", "ILHA JOANA...
$ CRPAAACODI <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2,...
$ CMICROCODI <dbl> 1, 2, 2, 3, 2, 3, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1,...
$ TBAIRRULAT <date> 1899-12-30, 1899-12-30, 1899-12-30, 1899-12-30, 1...
$ CEMPRECODI <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
$ AUSUACMATR <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
$ EBAIRRNO_1 <chr> "Recife", "Santo Antônio", "São José", "Ilha Joana...
$ EBAIRRLINK <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA...
$ geometry <MULTIPOLYGON [m]> MULTIPOLYGON (((294617.4 91..., MULTI...
And I have another dataFrame
, chamado
:
> chamado
# A tibble: 40,211 x 3
lat lon classe
<dbl> <dbl> <chr>
1 -7.99 -34.9 Deslizamento
2 -8.11 -34.9 Deslizamento
3 -8.13 -35.0 Deslizamento
4 -8.12 -34.9 Outros
5 -8.00 -34.9 Deslizamento
6 -8.01 -34.9 Deslizamento
7 -8.13 -34.9 Outros
8 -8.00 -34.9 Deslizamento
9 -8.06 -34.9 Outros
10 -8.05 -34.9 Outros
# ... with 40,201 more rows
I would like to add in map_recife
a new information that would count how many deslizamentos
, inundações
or outros
occurred for each neighborhood.
Thank you very much, Carlos. That’s what I needed!
– saulogr