biobabble作者群有一个小伙伴提出来的问题。

没错,凡是给biobabble投稿的小伙伴都会被拉入作者群。

话说有一个矩阵,我们让它某个值缺失,算出来的距离和原来的竟然是一样的:

> dat = matrix(1:10, 2)
> dist(dat)
         1
2 2.236068
> dat[1,1] = NA
> dist(dat)
         1
2 2.236068

这有点反直觉,实际上你再搞个缺失值,它算出来还是一样的:

> dat[1,3] = NA
> dist(dat)
         1
2 2.236068

但以我的经验,我通常不敢轻易说人家有bug,我们得确认一下。

Continue reading

Author's picture

Guangchuang Yu

Bioinformatics Professor @ SMU

Bioinformatics Professor

Guangzhou