findOutliers {clstutils} | R Documentation |
Outliers are defined as elements with edge length to the centermost element > cutoff. The distance threshold (cutoff) can be either specified, or calculated as a quantile of all pairwise distances in the matrix.
findOutliers(mat, quant, cutoff)
mat |
square matrix of distances |
quant |
given all pairwise distances x, calculate distance threshold as quantile(x, quant). Values closer to 0 are more stringent. |
cutoff |
an absolute cutoff overriding quant |
Returns a boolean vector corresponding to margin of mat; outliers have a value of TRUE.
Noah Hoffman
library(ape) data(seqs) data(seqdat) dmat <- ape::dist.dna(seqs[seqdat$tax_name == 'Enterococcus faecium',], pairwise.deletion=TRUE, as.matrix=TRUE, model='raw') summary(dmat[lower.tri(dmat)]) outliers <- findOutliers(dmat, cutoff=0.015) table(outliers)