R/double_center_distance_matrix.R
double_center_distance_matrix.Rd
Generates a double-centered matrix (row and column means are zero) from the weights of a distance matrix (see weights_from_distance_matrix()
) and a distance threshold. This is a required step before the computation of Moran's Eigenvector Maps.
double_center_distance_matrix (
distance.matrix = NULL,
distance.threshold = 0
)
Distance matrix. Default: NULL
.
Numeric, positive, in the range of values of x
. Distances below this value in the distance matrix are set to 0. Default: 0
.
A double-centered matrix of the same dimensions as x
.
if(interactive()){
#loading the distance matrix
data(distance_matrix)
x <- double_center_distance_matrix(
distance.matrix = distance_matrix
)
x
}