# \donttest{
# Example1: Check and load the vegetation raster map
# Make sure the required raster data is available
check_geodata(files = c("vege_1km_projected.tif"))
# Once the data is checked or downloaded, add the vegetation raster to a ggplot
ggplot() +
basemap_vege() +
theme_minimal()
# Example2: Customize color table
custom_colors <- data.frame(
code = 0:11,
type = c(
"Non-vegetated", "Needleleaf forest", "Needleleaf and broadleaf mixed forest",
"Broadleaf forest", "Scrub", "Desert", "Steppe", "Grassland",
"Meadow", "Swamp", "Alpine vegetation", "Cultivated vegetation"
),
col = c(
"#8D99B3", "#97B555", "#34BF36", "#9ACE30", "#2EC6C9", "#E5CE0E",
"#5BB1ED", "#6494EF", "#7AB9CB", "#D97A80", "#B87701", "#FEB780"
)
)
ggplot() +
basemap_vege(color_table = custom_colors) +
labs(fill = "Vegetation type group") +
theme_minimal()
# }
Run the code above in your browser using DataLab