Hi everyone,
I’m currently working on a project where I need to visualize a lower triangular phylogenetic distance matrix as a heatmap in R. My data is stored in a matrix format, but I only want to display the lower triangular part of it in the heatmap. I tried out suggestions from related questions but to no avail. I keep getting this error frequently -
Error in hclust(d, method = method): NA/NaN/Inf in foreign function
call (arg 10) In addition: Warning message: In dist(mat, method = > distance) : NAs introduced by coercion
Could anyone guide me on how to create a heatmap for this lower triangular matrix? Any help with the code or functions to use would be greatly appreciated!
Thank you!
Would it be possible to provide some code that you have tried out, or possibly some example data as well? It might help to find out what could be causing the error (if it is code related or data related)
Surely! Here's the code:
An example data table: