
Last chance! 50% off unlimited learning
Sale ends in
This function calculates a distance cutoff value for a specific distance matrix that makes the average neighbor rate (number of points within the distance cutoff value) fall between the provided range. The authors of the algorithm suggests aiming for a neighbor rate between 1 and 2 percent, but also states that the algorithm is quite robust with regards to more extreme cases.
estimateDc(distance, neighborRateLow = 0.01, neighborRateHigh = 0.02)
A numeric value giving the estimated distance cutoff value
A distance matrix
The lower bound of the neighbor rate
The upper bound of the neighbor rate
Rodriguez, A., & Laio, A. (2014). Clustering by fast search and find of density peaks. Science, 344(6191), 1492-1496. doi:10.1126/science.1242072
irisDist <- dist(iris[,1:4])
estimateDc(irisDist)
Run the code above in your browser using DataLab