Entering edit mode
11.1 years ago
liux.bio
▴
360
Hello, Biostars.I am new in R and statistics.I am using package 'cluster' in R to analyse microarray data. "FUNcluster" in the "clusGap" needs a argument k while hierarchical clustering method like hclust() has no argument k. What should I do? Best wishes.
Thanks! I did following your advice .But there is an error.
I checked the code of clusGap. Maybe something is wrong with cutree.
Sorry, didn't have time to test the code. I guess mycluster has to return a list, this is documented in the help page of clusGap(). I'm sure you can figure it out.
Try
mycluster <- function(x, k) list(cluster=cutree(hclust(mydist(x), method = "average"),k=k))
Yeah,you are right.Thank you.