View source: R/spatial_weights.R
cross_weighted_spatial_adjacency | R Documentation |
Compute the adjacency between two adjacency matrices weighted by two corresponding feature matrices.
cross_weighted_spatial_adjacency(
coord_mat1,
coord_mat2,
feature_mat1,
feature_mat2,
wsigma = 0.73,
alpha = 0.5,
nnk = 27,
maxk = nnk,
weight_mode = c("binary", "heat"),
sigma = 1,
dthresh = sigma * 2.5,
normalized = TRUE
)
coord_mat1 |
the first coordinate matrix (the query) |
coord_mat2 |
the second coordinate matrix (the reference) |
feature_mat1 |
the first feature matrix |
feature_mat2 |
the second feature matrix |
wsigma |
the sigma for the feature heat kernel |
alpha |
the mixing weight for the spatial distance (1=all spatial weighting, 0=all feature weighting) |
nnk |
the maximum number of spatial nearest neighbors to include |
maxk |
the maximum number of neighbors to include within spatial window |
dthresh |
the threshold for the spatial distance |
normalized |
whether to normalize the rows to sum to 1 |
coords <- as.matrix(expand.grid(1:5, 1:5))
fmat1 <- matrix(rnorm(5*25), 25, 5)
fmat2 <- matrix(rnorm(5*25), 25, 5)
adj <- cross_weighted_spatial_adjacency(coords, coords, fmat1, fmat2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.