I am trying to plot a heatmap using
I'm using the following script to set the parameters and plot the various clusters.
hmx.parameters <- list(counts_filtered_df, color = col.pal, cellwidth = 15, cellheight = 12, scale = "none", treeheight_row = 200, kmeans_k = 20, # maxclust, show_rownames = T, show_colnames = T, main = main, clustering_method = "average", cluster_rows = TRUE, cluster_cols = TRUE, clustering_distance_rows = drows1, clustering_distance_cols = NA) # To store cluster mappings and draw set.seed(123) kmean.hm <- do.call("pheatmap", hmx.parameters)
But I get the following error
Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)
I have read some questions about it and have checked the sd of my matrix. But it seems to be fine
> dim(sample_mat)  2297 100 > counts_filtered<- sample_mat[apply(sample_mat, MARGIN = 1, FUN = function(x) sd(x) != 0),] > dim(counts_filtered)  2297 100
So, even after trying to filter for
0 sd rows, it still does not run.
Is there any other reason for this problem?