Learn R Programming

spots (version 0.1.0)

IrregularData: Process irregular data shape (between two groups) for Moran's I

Description

Process irregular data shape for Moran's I between two groups.

Usage

IrregularData(X, W, group1, group2)

Arguments

X

A matrix with observations as rows and features as columns.

W

A weight matrix across all observations, i.e inverse of a pairwise distance matrix.

group1

The indices or names for the first group of observations.

group2

The indices or names for the second group of observations.

Value

A list containing the following:

  • X, new data matrix of group1 and group2.

  • W, new weight matrix of group1 and group2.

Examples

Run this code
# NOT RUN {
{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- IrregularData(data.use[,3:4], W, 1:10, 21:30)
}

# }

Run the code above in your browser using DataLab