Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

na_col doesn't work #93

Open
Ruiqi-CUB opened this issue Feb 3, 2023 · 1 comment
Open

na_col doesn't work #93

Ruiqi-CUB opened this issue Feb 3, 2023 · 1 comment

Comments

@Ruiqi-CUB
Copy link

Hi there, pheatmap gives me the error below when there is NA in my input. I installed it via github install_github("raivokolder/pheatmap"). Thanks a lot!

packageVersion("pheatmap")
[1] ‘1.0.12’

> pheatmap(as.matrix(ktable), na_col="black",clustering_distance_cols="correlation")
Error in hclust(d, method = method) : 
  NA/NaN/Inf in foreign function call (arg 10)
@AlexWeinreb
Copy link

This error indicates that the clustering fails because of NA. You can still get the (unclustered) heatmap with:

pheatmap(as.matrix(ktable),
         cluster_rows = FALSE,
         cluster_cols = FALSE,
         na_col="black")

To perform clustering in the presence of missing values, you have to make some decisions (removing them, imputing them, ...), which pheatmap() can not do for you. There is discussion elsewhere, e.g. here or there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants