[R-sig-Geo] how to get an attribute from a raster layer

Antonio Silva @olinto@l@t @ending from gm@il@com
Fri Dec 28 16:04:59 CET 2018


Dear list members

I need help to do something that should be easy but I could not execute.

I just want to plot a raster layer and use "z-value" as the title.

rst.data[[1]]
class       : RasterLayer
band        : 1  (of  4  bands)
dimensions  : 33, 45, 1485  (nrow, ncol, ncell)
resolution  : 0.25, 0.25  (x, y)
extent      : -50.25, -39, -29, -20.75  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
data source : /mnt/.../dataset-sss-ssd-rep-monthly_2016-11-12_sos.nc
names       : X2016.11.15.1
z-value     : 2016-11-15
zvar        : sos

Is it possible to extract the z-value value directly (2016-11-15)?

The best I could do was

plot(rst.data[[1]],main=substr(names(rst.data[[1]]),2,11))

Thanks a lot

Antonio Olinto
Fisheries Institute
São Paulo, Brazil

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list