From the maps
help:
This italy database comes from the NUTS III (Tertiary Administrative Units of the European Community) database of the United Nations Environment Programme (UNEP) GRID-Geneva data sets. These were prepared around 1989, and so may be somewhat out of date.
Back then Lombardy had only 10 provinces, so we'll use those.
library(maps)
lombardy_provs <- map('italy', c('Milan', 'Bergamo', 'Brescia', 'Como',
'Cremona', 'Lecco', 'Mantova', 'Varese',
'Pavia', 'Sondrio'),
resolution = 0)
The resolution = 0
argument is used to get the maximum resolution available, otherwise we'll get artifacts down the line.
![]()
We use the new sf
(simple features
) package to union these regions.
First we cast the map
object to a sf
library(sf)
#> Linking to GEOS 3.5.0, GDAL 2.1.1, proj.4 4.9.3
lombardy_sf_provs <- st_as_sf(lombardy_provs)
plot(lombardy_sf_provs)
![]()
Then we can 'union' them using st_union()
lombardy_sf <- st_union(lombardy_sf_provs)
plot(lombardy_sf, col = 'lightblue')
![]()
Imo the sf
format is more suitable for any use than the maps
format, YMMV.