spatCor: Compute Spatial Autocorrelation for SpatialExperiment objects

spatCorR Documentation

Compute Spatial Autocorrelation for SpatialExperiment objects

Description

Computes spatial autocorrelation using Moran's I statistic for a SpatialExperiment object, using an inverse squared distance weight matrix as default, or an inverse distance weight matrix as an alternative. It also tests for spatial autocorrelation assuming normality.

Usage

## S4 method for signature 'SpatialExperiment'
spatCor(spe, na.rm = FALSE, alternative = "two.sided", squared = TRUE)

Arguments

spe

An object of SpatialExperiment class.

na.rm

A logical indicating whether missing values should be removed.

alternative

A character string specifying the alternative hypothesis tested against the null hypothesis of no spatial autocorrelation; must be one of "two.sided", "less", or "greater", or any unambiguous abbreviation of these.

squared

A logical indicating whether the inverse distance weight matrix should be squared or not.

Value

A data.frame with the same row names as the original SpatialExperiment object. Columns include the observed Moran's I statistic, the expected Moran's I statistic under no spatial autocorrelation, the expected standard deviation under no spatial autocorrelation, and the p-value of the test.


rcastelo/GSVA documentation built on Dec. 17, 2024, 4:51 p.m.