as.vegclust(vegclust)
as.vegclust()所属R语言包:vegclust
Turns into vegclust objects
变成vegclust对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Attempts to turn its arguments into a vegclust object
尝试打开它的参数传递到一个vegclust对象
用法----------Usage----------
as.vegclust(x, cluster)
参数----------Arguments----------
参数:x
A site-by-species data matrix (raw mode), or a site-by-site distance matrix (distance mode).
一个网站的物种数据矩阵(原始模式),或一个网站的站点距离矩阵(远程模式)。
参数:cluster
A vector indicating the hard membership of each object in x to a set of groups.
一个向量表明该硬盘x一套班子成员中的每个对象的。
Details
详细信息----------Details----------
This function is used to generate vegclust objects which can then be used in vegclass to classify new data. The input classification is hard (i.e. yes/no membership), cluster centers are calculated as multivariate means, and the method for assigning new data is assumed to be k-means ("KM"), i.e. plots will be assigned to the nearest cluster center. If community data is given as site-by-species data matrix the cluster centroids are added as mobileCenters in the vegclust object. Centroids cannot be computed if community data is given as a site-by-site dissimilarity matrix.
此功能用于生成vegclust然后,可以使用在vegclass到新的数据分类的对象。输入分类是硬的(即是/否的成员),聚类中心计算作为多变量装置,并分配新的数据的方法,被假定为k-均值("KM"),即图将被分配给该最近的聚类中心。如果社区给出的数据是网站的物种数据矩阵的聚类中心,增加一条,作为mobileCenters中vegclust对象。如果不能计算质心社区给出的数据是作为一个网站的网站相异度矩阵。
值----------Value----------
An object of class vegclust.
对象的类vegclust。
(作者)----------Author(s)----------
Miquel De C谩ceres, Forest Science Center of Catalonia.
参见----------See Also----------
vegclust, vegclass
vegclust,vegclass
实例----------Examples----------
# Loads data [数据加载]
data(wetland)
# This equals the chord transformation (see also 'normalize' option in \code{\link{decostand}} from the vegan package)[这等于和弦转换(参见标准化选项\ {\的链接{decostand}}从素食包的代码)]
wetland.chord = as.data.frame(sweep(as.matrix(wetland), 1, sqrt(rowSums(as.matrix(wetland)^2)), "/"))
# Splits wetland data into two matrices of 30x27 and 11x22[湿地数据拆分成两个矩阵的30x27和11x22]
wetland.30 = wetland.chord[1:30,]
wetland.30 = wetland.30[,colSums(wetland.30)>0]
dim(wetland.30)
wetland.11 = wetland.chord[31:41,]
wetland.11 = wetland.11[,colSums(wetland.11)>0]
dim(wetland.11)
# Performs a K-means clustering of the data set with 30 sites[设置30个站点的数据进行K-means聚类]
wetland.km = kmeans(wetland.30, centers=3, nstart=10)
# Transforms the 'external' classification of 30 sites into a 'vegclust' object[转换的“外部”到“vegclust对象分类的30个站点]
wetland.30.vc = as.vegclust(wetland.30, wetland.km$cluster)
# Assigns the second set of sites according to the (k-means) membership rule [指定第二组的网站(k-均值)成员资格规则]
# That is, sites are assigned to the cluster whose cluster centroids is nearest.[也就是说,网站被分配到聚类中的聚类中心最近的。]
wetland.11.km = vegclass(wetland.30.vc, wetland.11)
# A similar 'vegclust' object is obtained when using the distance mode...[的距离模式一个类似“vegclust”使用对象时,得到...]
wetland.d.vc = as.vegclust(dist(wetland.30), wetland.km$cluster)
# which can be also used to produce the assignment of the second set of objects[其中,也可以使用以产生第二组对象的分配]
wetland.d.11 = as.data.frame(as.matrix(dist(wetland.chord)))[31:41,1:30]
wetland.d.11.km = vegclass(wetland.d.vc,wetland.d.11)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|