Joanna Papakonstantinou
2013-Feb-25 20:52 UTC
[R] Argument dendro must have class hclust - cutreeDynamic error
I am having difficulty getting the dynamic tree cut package to work. Given the data table "myddtable" LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H Blue23 I created a similarity matrix using DAISY and Gower metric and specified Place and Color columns as characters (since they are categorical variables)> dd.daisy<-daisy(myddtable, metric = "gower", stand = FALSE, type list(character=c("Place","Color")))Then I clustered using DIANA dd.diana<-diana(dd.daisy) I am trying to cutreeDynamic {dynamicTreeCut} as follows cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize = 1, method "hybrid",+ distM = dd.daisy,+ deepSplit (ifelse(method=="hybrid", 1, FALSE)),+ maxCoreScatter NULL, minGap = NULL,+ maxAbsCoreScatter = NULL, minAbsGap = NULL,+ maxDistToLabel = cutHeight,+ respectSmallClusters = TRUE, + verbose = 2, indent = 0) But get the following error: Warning in if (class(dendro) != "hclust") stop("Argument dendro must have class hclust.") : the condition has length > 1 and only the first element will be usedError in cutreeDynamic(dd.diana, cutHeight = 2, minClusterSize 1, method = "hybrid", : Argument dendro must have class hclust. Is this trying to tell me I cannot use this with DIANA but only with hclust? Please tell me what I am doing wrong. Thank you. *Joanna * [[alternative HTML version deleted]]