coords2listw | R Documentation |
Parameters for this should be based on biological knowledge. The algorithm does a k nearest neighbor search and then selects all cells that are less than maxDist distance from the center as neighbors with nonzero weights. If k is chosen too small then it's possible for the weight matrix to be nonsymmetric because the k nearest neighbors are not symmetric. Choosing k large seems to be pretty quick still.
coords2listw(x, k = 200, maxDist = 50, comp = NULL, W = 1)
x |
A matrix of coordinates (of cell centroids) |
k |
The maximum number of neighbors each cell can have |
maxDist |
The maximum distance a neighbor can be from the central cell |
comp |
A vector of integers, strings, or factors, indicating what tissue compartment each cell belongs to |
W |
The weights used for the surrounding cells. defaults to 1 |
Returns a list of matrices, where each matrix is the multivariate Moran's I for each tissue compartment.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.