Uses function Moran.I from the ape package to calculate the global spatial correlation of a point process with weights.

calcMoran(x, scol, mcol, ...)

Arguments

x

a numeric matrix, with rows corresponding to objects' positions and columns as spatial coordinates.

scol

a numeric scalar or vector that prescribes column numbers with spatial coordinates.

mcol

a numeric scalar that prescribes a column number with the measurement.

...

additional parameters passed to ape::Moran.I

Value

a list with observed, expected, sd, and p-value

Examples

library(ARCOS)
ARCOS::calcMoran(cbind(runif(100), runif(100), rnorm(100)), scol = c(1,2), mcol = 3)
#> $observed
#> [1] -0.01862649
#> 
#> $expected
#> [1] -0.01010101
#> 
#> $sd
#> [1] 0.01362486
#> 
#> $p.value
#> [1] 0.5314922
#>