spatCor | R Documentation |
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.
## S4 method for signature 'SpatialExperiment'
spatCor(spe, na.rm = FALSE, alternative = "two.sided", squared = TRUE)
spe |
An object of |
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. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.