calculate_statistics | R Documentation |
Method used to calculate the statistics of all layers. It can be re-used to calculate statistics for a cropped version of the rasters.
calculate_statistics(layercode, raster)
layercode |
character. Name of the layer. |
raster |
RasterLayer. The raster you want to calculate statistics for. |
A dataframe with the layercode and all basic statistics.
layer_stats
## Not run:
# calculate statistics of the SST and salinity in the Baltic Sea
# warning using tempdir() implies that data will be downloaded again in the
# next R session
x <- load_layers(c("BO_sstmax", "BO_salinity"), datadir = tempdir())
e <- extent(13, 31, 52, 66)
baltics <- crop(x, e)
View(rbind(calculate_statistics("SST Baltic Sea", raster(x, layer = 1)))
calculate_statistics("Salinity Baltic Sea", raster(x, layer = 2)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.