Error in hclust(dist(t(clu_data))) : N must be at least 2.

#Then we perform correlation heatmap to show the associations between eigengenes and environmental factors.

create trans_env object

t2 <- trans_env$new(dataset = dataset, add_data = metadata[, 1:7])
head(t2$data_env)

  Carbon_source Time Group Treatment Peak Replicate Fraction

A1F10 13C-S D21 A D21-13C-S HF 1 F10
A1F11 13C-S D21 A D21-13C-S HF 1 F11
B1F13 12C-S D21 A D21-12C-S LF 1 F13
A2F9 13C-S D21 A D21-13C-S HF 2 F9
A2F10 13C-S D21 A D21-13C-S HF 2 F10
A2F11 13C-S D21 A D21-13C-S HF 2 F11

calculate correlations

t2$cal_cor(add_abund_table = t1$res_eigen)
head(t2$res_cor)
by_group Taxa Env Correlation Pvalue AdjPvalue Significance
V1 All M11 Replicate 0.2721824 0.18808941 0.3177362
V2 All M1 Replicate -0.3576988 0.07916599 0.3177362
V3 All M2 Replicate 0.2953269 0.15179069 0.3177362
V4 All M3 Replicate 0.3427625 0.09347944 0.3177362
V5 All M15 Replicate 0.2706764 0.19064171 0.3177362
V6 All M4 Replicate -0.1009713 0.63105674 0.7324662

plot the correlation heatmap

t2$plot_cor()
I am trying to plot the correlation heatmap, but when I run the command "t2$plot_cor()", the following errors occurs.
Error in hclust(dist(t(clu_data))) : N must be at least 2.

Could you facilitate me to solve this error?

please edit your post so as to format your code as code
image
this forum provides the above button for that. and you can press it via keyboard CTRL+E

type or paste code here

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.