scl: Calculate Correlation Length

Description Usage Arguments Value Examples

View source: R/aacf.R

Description

Calculates the smallest and largest distances to specified autocorrelation values (e.g., 0.2) of the areal autocorrelation function (AACF). All 180 degrees from the origin of the AACF image are considered for the calculation.

Usage

1
scl(x, threshold = c(0.2, 1/exp(1)), create_plot = FALSE)

Arguments

x

A raster or matrix.

threshold

A numeric vector containing values between 0 and 1. Indicates the autocorrelation values to which the rates of decline are measured.

create_plot

Logical. Defaults to FALSE. If TRUE, the AACF and lines showing the considered directions of autocorrelation from the origin will be plotted.

Value

A list containing the minimum and maximum distances from an autocorrelation value of 1 to the specified autocorrelation values < 1. Distances are in the units of the x, y coordinates of the raster image. If more than one threshold value is specified, the order of this list will be [minval(t1), minval(t2), maxval(t1), maxval(t2)].

Examples

1
2
3
4
5
6
7
library(raster)

# import raster image
data(normforest)

# calculate Scl20, the minimum distance to an autocorrelation value of 0.2 in the AACF
Scl20 <- scl(normforest)[1]

geodiv documentation built on Sept. 5, 2021, 5:26 p.m.