plot_raster_by_name | R Documentation |
plot_raster_by_name
plots a raster from a list of rasters based on the provided raster name.
plot_raster_by_name(rasters, raster_name)
rasters |
list A list of rasters. |
raster_name |
character The name of the raster to be plotted. |
NULL This function does not return a value. It plots the raster if found.
## Not run:
# Define a list of rasters
rasters <- list(raster1 = raster::raster(matrix(1:100, 10, 10)),
raster2 = raster::raster(matrix(101:200, 10, 10)))
# Assign names to the rasters
names(rasters[[1]]) <- "raster1"
names(rasters[[2]]) <- "raster2"
# Plot a raster by its name
plot_raster_by_name(rasters, "raster1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.