# hypothetical list of country GDPs, clearly separated
# into either two or three groups
gdp <- c(460, 500, 900, 2000, 2100, 2400, 15000, 16000, 20000)
# find one threshold to separate into two groups
findTh(gdp)
# 8700
# find two thresholds to separate into two groups
findTh(gdp, n = 2)
# 1450 8700
# using the (old) defaults from the original functions
findTh(gdp, n = 2, hclustm = "complete", distm = "euclidean")
# 8700 18000 (?)Run the code above in your browser using DataLab