weights_from_distance_matrix {spatialRF} | R Documentation |
Transforms a distance matrix into weights (1/distance.matrix) normalized by the row sums. Used to compute Moran's I values and Moran's Eigenvector Maps. Allows to apply a threshold to the distance matrix before computing the weights.
weights_from_distance_matrix(
distance.matrix = NULL,
distance.threshold = 0
)
distance.matrix |
Distance matrix. Default: |
distance.threshold |
Numeric, positive, in the range of values of |
A weighted distance matrix.
if(interactive()){
#loading example distance matrix
data(distance_matrix)
#computing matrix of weights
distance.matrix.weights <- weights_from_distance_matrix(
distance.matrix = distance_matrix
)
distance.matrix.weights
}