cutree(stats)
cutree()所属R语言包:stats
Cut a Tree into Groups of Data
削减成组数据的树
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Cuts a tree, e.g., as resulting from hclust, into several groups either by specifying the desired number(s) of groups or the cut height(s).
削减一棵树,如造成hclust,无论是几组到指定所需的号码(S),团体或切割高度(S)。
用法----------Usage----------
cutree(tree, k = NULL, h = NULL)
参数----------Arguments----------
参数:tree
a tree as produced by hclust. cutree() only expects a list with components merge, height, and labels, of appropriate content each.
一棵树,作为生产hclust。 cutree()只希望一个组件列表merge,height,labels,适当的内容每个。
参数:k
an integer scalar or vector with the desired number of groups
同组的所需数量的一个整数的标量或矢量
参数:h
numeric scalar or vector with heights where the tree should be cut.
数字标量或矢量应削减树的高度。
Details
详情----------Details----------
Cutting trees at a given height is only possible for ultrametric trees (with monotone clustering heights).
在一个给定的高度切割树木是唯一可能的树木的(单调聚类高度)超度量。
值----------Value----------
cutree returns a vector with group memberships if k or h are scalar, otherwise a matrix with group memberships is returned where each column corresponds to the elements of k or h, respectively (which are also used as column names).
cutree返回向量组成员k或h标,否则返回一个组成员的矩阵,每一列对应元素k或h,分别为(亦列名)。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
hclust, dendrogram for cutting trees themselves.
hclust,dendrogram砍树本身的。
举例----------Examples----------
hc <- hclust(dist(USArrests))
cutree(hc, k=1:5) #k = 1 is trivial[K = 1是微不足道]
cutree(hc, h=250)
## Compare the 2 and 4 grouping:[#比较2和4分组:]
g24 <- cutree(hc, k = c(2,4))
table(grp2=g24[,"2"], grp4=g24[,"4"])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|