I'm still a newbie to R and I need the complete syntax of the hclust function. I don't know how to get the full syntax of the .Fortran function contained in the hclust function. Below are .Fortran functions that are used there are 2:
hcl <- .Fortran(C_hclust, n = n, len = len, method = as.integer(i.meth),
ia = integer(n), ib = integer(n), crit = double(n), members = as.double(members),
nn = integer(n), disnn = double(n), diss = d)
hcass <- .Fortran(C_hcass2, n = n, ia = hcl$ia, ib = hcl$ib,
order = integer(n), iia = integer(n), iib = integer(n))
and below hclust function that i get from run syntax hclust in R
function (d, method = "complete", members = NULL)
{
METHODS <- c("ward.D", "single", "complete",
"average", "mcquitty", "median", "centroid",
"ward.D2")
if (method == "ward") {
message("The \"ward\" method has been renamed to \"ward.D\"; note new \"ward.D2\"")
method <- "ward.D"
}
i.meth <- pmatch(method, METHODS)
if (is.na(i.meth))
stop("invalid clustering method", paste("",
method))
if (i.meth == -1)
stop("ambiguous clustering method", paste("",
method))
n <- as.integer(attr(d, "Size"))
if (is.null(n))
stop("invalid dissimilarities")
if (is.na(n) || n > 65536L)
stop("size cannot be NA nor exceed 65536")
if (n < 2)
stop("must have n >= 2 objects to cluster")
len <- as.integer(n * (n - 1)/2)
if (length(d) != len)
(if (length(d) < len)
stop
else warning)("dissimilarities of improper length")
if (is.null(members))
members <- rep(1, n)
else if (length(members) != n)
stop("invalid length of members")
storage.mode(d) <- "double"
hcl <- .Fortran(C_hclust, n = n, len = len, method = as.integer(i.meth),
ia = integer(n), ib = integer(n), crit = double(n), members = as.double(members),
nn = integer(n), disnn = double(n), diss = d)
hcass <- .Fortran(C_hcass2, n = n, ia = hcl$ia, ib = hcl$ib,
order = integer(n), iia = integer(n), iib = integer(n))
structure(list(merge = cbind(hcass$iia[1L:(n - 1)], hcass$iib[1L:(n -
1)]), height = hcl$crit[1L:(n - 1)], order = hcass$order,
labels = attr(d, "Labels"), method = METHODS[i.meth],
call = match.call(), dist.method = attr(d, "method")),
class = "hclust")
}
If you know how to get the full syntax fo .Fortran, let me know and thank you so muchhhh.