[BioC] hclustfun argument in heatmap.2 function
James W. MacDonald
jmacdon at med.umich.edu
Fri Jul 31 14:50:03 CEST 2009
Hi Carol,
carol white wrote:
> Hi,
> When using hclustfun argument in heatmap.2 function, I get the error message below. Note that I want to use average linkage with pearson correlation.
>
> heatmap.2(as.matrix(mtcars), dendrogram = "none", hclustfun = hclust(as.dist(1-cor(t(as.matrix(mtcars)), method = "pearson")),method = "average"))
> Error in heatmap.2(as.matrix(mtcars), dendrogram = "none", hclustfun = hclust(as.dist(1 - :
> could not find function "hclustfun"
The argument hclustfun expects you to pass a function name, not the
output from calling the function you want to use (which is what you are
doing).
> myfun <- function(x) hclust(as.dist(1-cor(t(as.matrix(x)), method =
"pearson")), method = "average")
> heatmap.2(as.matrix(mtcars), dendrogram = "none", hclustfun = myfun)
Best,
Jim
>
>
> I use the R version
>
>> version _
> platform x86_64-redhat-linux-gnu
> arch x86_64
> os linux-gnu
> system x86_64, linux-gnu
> status
> major 2
> minor 5.1
> year 2007
> month 06
> day 27
> svn rev 42083
> language R
> version.string R version 2.5.1 (2007-06-27)
>
> thanks,
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
James W. MacDonald, M.S.
Biostatistician
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
734-615-7826
More information about the Bioconductor
mailing list