[BioC] error in hclust function

James F. Reid james.reid at ifom-ieo-campus.it
Sat Jun 2 16:25:29 CEST 2012


Hi Alyaa,

you probably have missing values (see 'NA/NaN/Inf in foreign function 
call (arg 11)') in your bb matrix.

HTH.
J.

On 02/06/12 13:57, Alyaa Mahmoud wrote:
> Hi All
>
> I am trying to cluster 57 COGs in 24 datasets. I use the following code and
> run into this error:
>
> hc = NULL
> hc<- hclust(as.dist(1-cor(as.matrix(bb), method="spearman")),
> method="complete", members=NULL)
>
> Error in hclust(as.dist(1 - cor(as.matrix(bb), method = "spearman")),  :
>    NA/NaN/Inf in foreign function call (arg 11)
> In addition: Warning message:
> In cor(as.matrix(bb), method = "spearman") : the standard deviation is zero
>
> hr = NULL
> hr<- hclust(as.dist(1-cor(t(as.matrix(bb)), method="spearman")),
> method="complete", members=NULL)
>
> I tried to remove any rows that have sd of zero but there was none;
> ind<- apply(bb, 1, var) == 0
> subset<- bb[!ind,]
>
> or
>
> ind<- apply(bb, 1, sd) == 0
> subset<- bb[!ind,]
>
>
> any clue what coule the problem be ?
>
> Thanks a lot for your help
> yours,
> Alyaa



More information about the Bioconductor mailing list