library(sf)
library(ggplot2)
library(mapview)
library(lwgeom)
library(rnaturalearth)
# world data
world <- rnaturalearth::ne_countries(scale = 'small', returnclass = 'sf')
# Fix polygons so they don't get cut in ortho projection
world <- st_cast(world, 'MULTILINESTRING') %>%
st_cast('LINESTRING', do_split=TRUE) %>%
mutate(npts = npts(geometry, by_feature = TRUE)) %>%
st_cast('POLYGON')
# map
ggplot() +
geom_sf(data=world, color="gray80", aes(fill=continent)) +
coord_sf( crs= "+proj=ortho +lat_0=20 +lon_0=-30")
ggplot() +
geom_sf(data=world, color="gray80", aes(fill=continent)) +
coord_sf( crs= "+proj=ortho +lat_0=20 +lon_0=90")
Created
October 7, 2019 17:25
-
-
Save rafapereirabr/6a58d3ded83b4b7ad3a0f360565d05c6 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment