powered by
Extend the stats quantile function for handling distancematrix objects.
quantile
# S4 method for distancematrix quantile(x, probs, ...)
numeric vector of quantiles corresponding to the given probabilities
A distancematrix object.
numeric vector or probabilities with values in [0,1].
Additional arguments, passed to quantile.
Cole Beck
The upper.triangular values of the distance matrix object are passed to the quantile function.
plainmatrix<-as.matrix(dist(sample(1:25, 8, replace=TRUE))) mdm<-distancematrix(plainmatrix) quantile(mdm, probs=c(0.0, 0.25, 0.50, 0.75, 1.00))
Run the code above in your browser using DataLab