Learn R Programming

spatialwarnings (version 1.2)

raw_moran: Spatial correlation at lag 1

Description

This function computes the Moran's I index of spatial correlation at lag 1.

Usage

raw_moran(mat)

Arguments

mat

A matrix

Value

The Moran's I numeric value as a numeric number.

Details

This function returns the spatial correlation as measured by the Moran's I index. If the variance of the matrix is zero, then NaN is returned.

See Also

indicator_moran, generic_sews

Examples

Run this code
# NOT RUN {
# Spatial correlation of white noise is close to zero
rmat <- matrix(runif(1000) > .5, ncol = 100)
raw_moran(rmat) 

# }

Run the code above in your browser using DataLab