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
because I thought it could be used with any of the hierarchical methods?
I hope someone can please tell me what I am doing wrong.
Thank you.
--
******************************************************************
*Joanna Papakonstantinou, Ph.D.*
[[alternative HTML version deleted]]