Excuse me,
saying:
Error in if (key) { : argument is not interpretable as logical
In addition: Warning message:
In if (key) { :
the condition has length > 1 and only the first element will be used
Sorry, you are using Ward clustering but in
hr <- hclust(as.dist(1-cor(t(y), method="pearson")), method="complete")
hc <- hclust(as.dist(1-cor(y, method="spearman")), method="complete")
you also using
Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc)
Is this a double clustering?
May be you can try pheatmap https://cran.r-project.org/web/packages/pheatmap/pheatmap.pdf