Question: heatmap{mva}
0
15.6 years ago by
Ivan Borozan20
Ivan Borozan20 wrote:
Hi all, In heatmap{mva} would it be possible to use (in distfun=dist) a different distance measure from the one provided as default (i.e. "euclidean")? Also would it be possible to use (in hclustfun) a different agglomeration method from that provided as default i.e. ("complete") ? if i do: heatmap(mattest,distfun=dist(method="manhattan"),hclustfun=hclust(meth od="average") ,scale=c("none")) i get Error in as.integer(attr(d, "Size")) : Argument "d" is missing, with no default also if i do heatmap(mattest,distfun=dist(mattest,method="manhattan"),hclustfun=hcl ust(dist(mattest), method="average"),scale="none") i get Error in heatmap(mattest, distfun = dist(mattest, method = "manhattan"), : couldn't find function "hclustfun" best regards, ivan
• 561 views
modified 15.6 years ago by Martin Maechler330 • written 15.6 years ago by Ivan Borozan20
0
15.6 years ago by
Switzerland
Martin Maechler330 wrote:
>>>>> "Ivan" == Ivan Borozan <ivan@ebi.ac.uk> >>>>> on Wed, 13 Aug 2003 14:54:14 +0100 (BST) writes: Ivan> Hi all, Ivan> In heatmap{mva} would it be possible to use (in Ivan> distfun=dist) a different distance measure from the one provided as Ivan> default (i.e. "euclidean")? Also would it be Ivan> possible to use (in hclustfun) a different agglomeration method from that Ivan> provided as default i.e. ("complete") ? Ivan> if i do: Ivan> heatmap(mattest,distfun=dist(method="manhattan"),hclustfun=h clust(method="average") Ivan> ,scale=c("none")) Ivan> i get Ivan> Error in as.integer(attr(d, "Size")) : Argument "d" is missing, with no Ivan> default Ivan> also if i do Ivan> heatmap(mattest,distfun=dist(mattest,method="manhattan"),hcl ustfun=hclust(dist(mattest), Ivan> method="average"),scale="none") Ivan> i get Ivan> Error in heatmap(mattest, distfun = dist(mattest, method = "manhattan"), Ivan> : Ivan> couldn't find function "hclustfun" If you *either* read the documentation "help(heatmap)" *or* the error message, then you should find that these must be *function* s -- whereas you passed *result objects* of function calls. Maybe reread the "Details" section of that help page. Finally, one solution for the `distfun' part : Use heatmap(mattest, distfun = function(m) dist(m, method="manhattan")) or equivalently, but maybe easier for beginners: mydist <- function(m) dist(m, method = "manhattan") heatmap(mattest, distfun = mydist) Regards, Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><