consensus {agricolae} | R Documentation |
The criterion of the consensus is to produce many trees by means of boostrap and to such calculate the relative frequency with members of the clusters.
consensus(data,distance=c("binary","euclidean","maximum","manhattan", "canberra", "minkowski"),method=c("complete","ward","single","average", "mcquitty","median", "centroid"),nboot=500,duplicate=TRUE,cex.text=1, col.text="red", ...)
data |
data frame |
distance |
method distance, see dist() |
method |
method cluster, see hclust() |
nboot |
The number of bootstrap samples desired. |
duplicate |
control is TRUE other case is FALSE |
cex.text |
size text on percentage consensus |
col.text |
color text on percentage consensus |
... |
parameters of the plot dendrogram |
distance: "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski". Method: "ward", "single", "complete", "average", "mcquitty", "median", "centroid". see functions: dist(), hclust().
data |
numerical, the rownames is necesary' |
nboot |
integer |
duplicate |
logical TRUE or FALSE |
cex.text |
size text on consensus |
col.text |
color text on consensus |
F. de Mendiburu
An Introduction to the Boostrap. Bradley Efron and Robert J. Tibshirani. 1993. Chapman and Hall/CRC
library(agricolae) data(pamCIP) # only code rownames(pamCIP)<-substr(rownames(pamCIP),1,6) par(cex=0.8) output<-consensus( pamCIP,distance="binary", method="complete",nboot=500) # Order consensus Groups<-output$table.dend[,c(6,5)] Groups<-Groups[order(Groups[,2],decreasing=TRUE),] print(Groups) # Identification of the codes with the numbers. cbind(output$dendrogram$labels) # To reproduce dendrogram dend<-output$dendrogram data<-output$table.dend plot(dend) text(data[,3],data[,4],data[,5]) # Other examples # classical dendrogram dend<-as.dendrogram(output$dendrogram) plot(dend,type="r",edgePar = list(lty=1:2, col=2:1)) text(data[,3],data[,4],data[,5],col="blue",cex=1) # plot(dend,type="t",edgePar = list(lty=1:2, col=2:1)) text(data[,3],data[,4],data[,5],col="blue",cex=1) # Without the control of duplicates output<-consensus( pamCIP,duplicate=FALSE,nboot=100)