[This article was first published on r.iresmi.net, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Day 13 of 30DayMapChallenge : « 5 minutes map » (previously).
Sugar cane fields in La Réunion
library(tidyverse)
library(sf)
# RPG région La Réunion édition 2021
# https://wxs.ign.fr/0zf5kvnyfgyss0dk5dvvq9n7/telechargement/prepackage/RPG_REGION_PACK_DIFF_2021-01-01$RPG_2-0__SHP_RGR92UTM40S_R04_2021-01-01/file/RPG_2-0__SHP_RGR92UTM40S_R04_2021-01-01.7z
parc <- read_sf("~/PARCELLES_GRAPHIQUES.shp")
# https://geoservices.ign.fr/adminexpress
# COG
dep <- read_sf("~/DEPARTEMENT.shp") %>%
filter(INSEE_DEP == "974")
parc %>%
ggplot() +
geom_sf(data = dep, fill = "white", color = "blue") +
geom_sf(aes(fill = CODE_CULTU %in% c(
"CSA",
"CSF",
"CSI",
"CSP",
"CSR")), color = NA) +
scale_fill_manual(values = list("TRUE" = "goldenrod",
"FALSE" = "lightgrey"),
labels = list("TRUE" = "Cane",
"FALSE" = "Other")) +
labs(title = "Sugar cane fields",
subtitle = "La Réunion",
fill = "Crop") +
theme_minimal() +
theme(plot.background = element_rect(fill = "lightblue1"))
ggsave("reunion.png", width = 20, height = 20, units = "cm", scale = 1.1)
To leave a comment for the author, please follow the link and comment on their blog: r.iresmi.net.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
