metrics_pull: Transform raster stack values to intensity values

Description Usage Arguments Value See Also Examples

View source: R/metrics.R

Description

This function transforms raster stack values that describe individual distributions or species distributions into standardized intensity values. All the distributional information in the original raster stack is preserved for visualization.

Usage

1

Arguments

x

RasterStack of distributions. Layers typically contain information about the distribution of a single individual or species at multiple points in time. Alternatively, layers may contain information about the distributions of multiple individuals or species within a single time period. Other conceptualizations are possible.

Value

A RasterStack containing intensity values. Intensity values are calculated by dividing cell values in every layer by the maximum cell value in the entire stack, thus ensuring intensities are comparable across layers.

The maximum cell value in the stack is stored as the "maximum" attribute.

See Also

Other metrics: metrics_distill()

Examples

1
2
3
4
5
6
# load elephant data
data("elephant_ud")
r <- metrics_pull(elephant_ud)
print(r)
# maximum value for the stack stored as an attribute
attr(r, "maximum")

Example output

sh: 1: awk: Permission denied
Warning message:
In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum Unknown based on WGS84 ellipsoid in CRS definition
class      : RasterBrick 
dimensions : 208, 193, 40144, 2  (nrow, ncol, ncell, nlayers)
resolution : 500, 500  (x, y)
extent     : -58642.18, 37857.82, -2376938, -2272938  (xmin, xmax, ymin, ymax)
crs        : +proj=moll +lon_0=15.8231920275931 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs 
source     : /work/tmp/tmp/RtmpQRYUXN/raster/r_tmp_2021-04-01_082022_960541_46944.grd 
names      :      LA11,      LA14 
min values :         0,         0 
max values : 0.8525854, 1.0000000 

[1] 0.002409927

colorist documentation built on Nov. 24, 2020, 1:08 a.m.