Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

raster.Zscore

Modified z-score for a raster


Description

Calculates the modified z-score for all cells in a raster

Usage

raster.Zscore(x, p.value = FALSE, file.name = NULL, ...)

Arguments

x

A raster class object

p.value

Return p-value rather than z-score raster (FALSE/TRUE)

file.name

Name of raster written to disk

...

Additional arguments passed to writeRaster

Value

raster class object or raster written to disk

Note

Since this functions needs to operate on all of the raster values, it is not memory safe

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

library(raster)
r <- raster(nrows=824, ncols=767, xmn=2451905, xmx=3218905, 
            ymn=-2744771, ymx=-1920771, resolution = 5000)
  r[] <- runif(ncell(r), 0, 1)

# Modified z-score
z <- raster.Zscore(r)

# P-value
p <- raster.Zscore(r, p.value = TRUE)

spatialEco

Spatial Analysis and Modelling Utilities

v1.3-6
GPL-3
Authors
Jeffrey S. Evans [aut, cre], Melanie A. Murphy [ctb], Karthik Ram [ctb]
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.