Learn R Programming

spatialEco (version 2.0-2)

correlogram: Correlogram

Description

Calculates and plots a correlogram

Usage

correlogram(x, v, dist = 5000, ns = 99, ...)

Value

Plot of correlogram and a list object containing:

  • autocorrelation is a data.frame object with the following components

  • autocorrelation - Autocorrelation value for each distance lag

  • dist - Value of distance lag

  • lci - Lower confidence interval (p=0.025)

  • uci - Upper confidence interval (p=0.975)

  • CorrPlot recordedplot object to recall plot

Arguments

x

A sf POINT object

v

Test variable in x

dist

Distance of correlation lags, if latlong=TRUE units are great circle in kilometers

ns

Number of simulations to derive simulation envelope

...

Arguments passed to cor ('pearson', 'kendall' or 'spearman')

Author

Jeffrey S. Evans jeffrey_evans@tnc.org

Examples

Run this code
library(sf)
if(require(sp, quietly = TRUE)) {
  data(meuse, package = "sp")
  meuse <- st_as_sf(meuse, coords = c("x", "y"), crs = 28992, 
                    agr = "constant")
}

zinc.cg <- correlogram(x = meuse, v = meuse$zinc, dist = 250, ns = 9)

Run the code above in your browser using DataLab