Colors | R Documentation |
SpatRaster
colorsThis is a wrapper to help with migration to terra.
Currently can only be used for a single layer SpatRaster
or a RasterLayer
.
Colors(ras, cols, n = NULL)
ras |
A |
cols |
a character vector of colours. See examples. Can also be a |
n |
A numeric scalar giving the number of colours to create. Passed to
|
cols <- colorRampPalette(c("blue", "red"))(12)
ras <- terra::rast(matrix(1:100, 10, 10))
ras <- Colors(ras, cols)
terra::plot(ras)
ras <- raster::raster(matrix(1:100, 10, 10))
ras <- Colors(ras, cols)
raster::plot(ras)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.