# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (d, method = "complete", members = NULL, d2 = NULL,
alpha = NULL)
{
if (!is.null(d2)) {
if (!length(d) == length(d2)) {
stop("d and d2 have not the same size.")
}
if (is.null(alpha)) {
sa <- hclustcompro_select_alpha(d, d2, method = method,
resampling = FALSE)
alpha <- sa$alpha[1]
}
alpha <- as.numeric(alpha)
if (!(alpha > 0 & alpha < 1)) {
warning("Alpha must be between 0 and 1.")
sa <- hclustcompro_select_alpha(d, d2, method = method,
resampling = FALSE)
alpha <- sa$alpha[1]
}
d <- dist(alpha * d + (1 - alpha) * d2)
}
stats::hclust(d, method, members)
}
# }
Run the code above in your browser using DataLab