Skip to content
Prev 27027 / 29559 Next

how to get an attribute from a raster layer

Hi,

You are looking for raster::getZ() but be aware that the Z value can be of any type - in this case I would guess it is a Date class so you will need to cast it to character using format() to get a label you desire.

https://www.rdocumentation.org/packages/raster/versions/2.8-4/topics/z-values


Cheers,
Ben
Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/