Error while plotting heatmap
Entering edit mode
3 months ago
mrinsmrids • 0

I am getting this strange error while plotting my heatmap which contains the matrix, sampleDistMatrix. sampleDistMatrix is a matrix that contains 28 rows and 1 column. sampleDists contain 28 rows . The following are the screenshot of the values inside sampleDistmatrix and sampleDists respectively.

enter image description here enter image description here

The code is as follows:

       clustering_distance_rows = sampleDists,
       clustering_distance_cols = sampleDists,
       clustering_method = 'ward.D', fontsize = 8,
       col = colors)

The error that I receive to the following code :

Error in cluster_mat(mat, distance = clustering_distance_rows, method = clustering_method) : distance has to be a dissimilarity structure as produced by dist or one measure form the list: 'correlation', 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary', 'minkowski'

What is the necessary correction that I need to do in order to plot my heat map successfully?

heatmap RStudio • 312 views
Entering edit mode

It is telling you that ward.D is not a supported clustering method, and that you need to pick between the supported ones: c('dist','correlation', 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary', 'minkowski'). Aloso, not sure if this will cause an error later, but pheatmap might not like to work with only 1 column, especially if you are trying to cluster on 1 value.

Entering edit mode

Thank you for the help. But I tried using the following methods and it still outputs the same error.If the error is caused due to the second reason as you stated, then how should I input my data in order to plot the heat map?


Login before adding your answer.

Traffic: 1150 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6