TransWikia.com

How can I add the outline of Europe countries in this figure in R?

Geographic Information Systems Asked by Gloam on April 13, 2021

enter image description here

Here is my code to create this distribution map of Europe in R. So how can I add the outline in this figure to divide different countries and also add the countries’ names in relevant regions?

>library(sf)
>library(rgbif)
>all <- st_read('~/Desktop/amre2935_supplementary_atlas_s4_shapefiles_reptiles/allcountries_rep.shp')
>all <- subset(all, select='emy_orb')
> summary(all)
    emy_orb                geometry   
 Min.   :0.0000   POLYGON      :5453  
 1st Qu.:0.0000   epsg:4326    :   0  
 Median :0.0000   +proj=long...:   0  
 Mean   :0.1423                       
 3rd Qu.:0.0000                       
 Max.   :1.0000  
> all
Simple feature collection with 5453 features and 1 field
geometry type:  POLYGON
dimension:      XY
bbox:           xmin: -14.3358 ymin: 34.30561 xmax: 66.7329 ymax: 71.65074
geographic CRS: WGS 84
First 10 features:
   emy_orb                       geometry
1        0 POLYGON ((-14.3358 47.4027,...
2        0 POLYGON ((-13.6733 47.39694...
3        0 POLYGON ((-13.01106 47.3873...
4        0 POLYGON ((-12.34923 47.3739...
5        0 POLYGON ((-14.29924 50.1012...
6        0 POLYGON ((-14.30573 49.6515...
7        0 POLYGON ((-14.28579 51.0004...
8        0 POLYGON ((-14.29261 50.5508...
9        0 POLYGON ((-14.2788 51.45003...
10       0 POLYGON ((-14.32421 48.3023...
>pal <- c('grey', 'red')
>plot(all['emy_orb'], key.pos=NULL, reset=FALSE, main='All Countries', pal=pal, border=NA)

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP