library(tidyverse)
library(rnaturalearth)
#?rnaturalearth::ne_countries()
library(rnaturalearthhires)
#?rnaturalearthhires::coastline10
library(sf)
Overview
World
map of the Coastlines Scalerank. Data is from {rnaturalearthhires}
package.
::font_add_google("Smooch Sans","Smooch Sans")
sysfonts::showtext_auto() showtext
<- ne_countries(returnclass = "sf")
sf_world <- rnaturalearthhires::coastline10
coasts
<- coasts%>%
coastlinesst_as_sf()%>%
mutate(scalerank=as.integer(scalerank),
scalerank=as.factor(scalerank)
)
ggplot()+
geom_sf(data=sf_world,fill="#88398a",color=NA)+
geom_sf(data=coastlines,
mapping=aes(color=scalerank),
show.legend = T)+
scale_color_viridis_d()+
coord_sf(crs = 'ESRI:54030',clip = "off")+
labs(title="Coastlines",color="Scalerank",
subtitle="#30DayMapChallenge 2023 Day 20 Outdoors",
caption="DataSource: {rnaturalearthhires} | Map: @fgazzelloni")+
theme(text=element_text(family="Smooch Sans",size=40,face="bold"),
plot.title = element_text(hjust = 0.5),
plot.subtitle = element_text(hjust = 0.5),
plot.caption = element_text(hjust = 0.5),
plot.background = element_rect(color="#bfd0dd",fill="#bfd0dd"),
panel.background = element_rect(color="#bfd0dd",fill="#bfd0dd"),
legend.background = element_rect(color="#bfd0dd",fill="#bfd0dd"))
::showtext_end() showtext
ggsave("day20_outdoors.png",bg="#bfd0dd",height = 4)