Learn R Programming

spatialEco (version 0.1-5)

correlogram: Correlogram

Description

Calculates and plots a correlogram

Usage

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

Arguments

x
SpatialPointsDataFrame object
v
Test variable in x@data
dist
Distance of correlation lags, if latlong=TRUE units are in kilometres
dmatrix
Should the distance matrix be include in output (TRUE/FALSE)
ns
Number of simulations to derive simulation envelope
latlong
Coordinates are in latlong (TRUE/FALSE)
...
Arguments passed to cor ('pearson', 'kendall' or 'spearman')

Value

A list object containing:autocorrelation is a data.frame object with the following componentsautocorrelation - Autocorrelation value for each distance lagdist - Value of distance laglci - Lower confidence interval (p=0.025)uci - Upper confidence interval (p=0.975)CorrPlot recordedplot object to recall plotdmatrix Distance matrix (if dmatrix=TRUE)

Examples

Run this code
library(sp)
data(meuse)
coordinates(meuse) = ~x+y
zinc.cg <- correlogram(x = meuse, v = meuse@data[,'zinc'], dist = 250, ns = 9)

Run the code above in your browser using DataLab