hclusterpar {amap} | R Documentation |
Parallelized Hierarchical cluster analysis.
hclusterpar(x, method = "euclidean", diag = FALSE, upper = FALSE, link = "complete", members = NULL, nbproc = 2)
x |
numeric matrix or (data frame). Distances between the rows of
x will be computed. |
method |
the distance measure to be used. This must be one of
"euclidean" , "maximum" , "manhattan" ,
"canberra" "binary" "pearson" ,
"correlation" or "spearman" .
Any unambiguous substring can be given. |
diag |
logical value indicating whether the diagonal of the
distance matrix should be printed by print.dist . |
upper |
logical value indicating whether the upper triangle of the
distance matrix should be printed by print.dist . |
link |
the agglomeration method to be used. This should
be (an unambiguous abbreviation of) one of
"ward" , "single" , "complete" ,
"average" , "mcquitty" , "median" or
"centroid" . |
members |
NULL or a vector with length size of d . |
nbproc |
Integer, number of subprocess for parallelization |
This function is a mix of function hclust
and function
distpar
. hcluster(x, method = "euclidean",link = "complete")
= hclust(dist(x, method = "euclidean"),method = "complete"))
For more details, see documentation of hclust
and dist
.
An object of class hclust which describes the tree produced by the clustering process. The object is a list with components:
merge |
an n-1 by 2 matrix.
Row i of merge describes the merging of clusters
at step i of the clustering.
If an element j in the row is negative,
then observation -j was merged at this stage.
If j is positive then the merge
was with the cluster formed at the (earlier) stage j
of the algorithm.
Thus negative entries in merge indicate agglomerations
of singletons, and positive entries indicate agglomerations
of non-singletons. |
height |
a set of n-1 non-decreasing real values.
The clustering height: that is, the value of
the criterion associated with the clustering
method for the particular agglomeration. |
order |
a vector giving the permutation of the original
observations suitable for plotting, in the sense that a cluster
plot using this ordering and matrix merge will not have
crossings of the branches. |
labels |
labels for each of the objects being clustered. |
call |
the call which produced the result. |
method |
the cluster method that has been used. |
dist.method |
the distance that has been used to create d
(only returned if the distance object has a "method"
attribute). |
There is a print
and a plot
method for
hclust
objects.
The plclust()
function is basically the same as the plot method,
plot.hclust
, primarily for back compatibility with S-plus. Its
extra arguments are not yet implemented.
The hcluster
function is based on C code
by Antoine Lucas http://mulcyber.toulouse.inra.fr/projects/amap/.
data(USArrests) hc <- hclusterpar(USArrests,link = "ave",nbproc=8) plot(hc) plot(hc, hang = -1) ## To check... hc <- hcluster(USArrests,link = "ave") plot(hc) ## The same ?