Skip to contents

Convenience function for setting SpatRaster layer names, enables setting in piped workflows.

Usage

set_layer_names(x, layernames)

Arguments

x

SpatRaster

layernames

character of length nlyr(x)

Value

SpatRaster

Examples

example_raster() |>
 set_layer_names("Charlie Watts")
#> class       : SpatRaster 
#> dimensions  : 10, 10, 1  (nrow, ncol, nlyr)
#> resolution  : 1, 1  (x, y)
#> extent      : 0, 10, 0, 10  (xmin, xmax, ymin, ymax)
#> coord. ref. :  
#> source(s)   : memory
#> name        : Charlie Watts 
#> min value   :     0.0627102 
#> max value   :     7.3352526