talgalili / dendextend

Extending R's Dendrogram Functionality
152 stars 28 forks source link

cor_bakers_gamma error #103

Open caitsimop opened 3 years ago

caitsimop commented 3 years ago

I'm following your tutorial and am running into an error when I try to reproduce the 95% confidence interval of cor_bakers_gamma() results.

Specifically, I'm using this code chunk with my two own small dendrograms:

dend1 <- dend15
dend2 <- dend51

set.seed(23801)

R <- 100
dend1_labels <- labels(dend1)
dend2_labels <- labels(dend2)
cor_bakers_gamma_results <- numeric(R)
for(i in 1:R) {
   sampled_labels <- sample(dend1_labels, replace = TRUE)
   dend_mixed1 <- sample.dendrogram(dend1, 
                                    dend_labels=dend1_labels,
                                    fix_members=TRUE,fix_order=TRUE,fix_midpoint=FALSE,
                                    replace = TRUE, sampled_labels=sampled_labels
                                      )
   dend_mixed2 <- sample.dendrogram(dend2, dend_labels=dend2_labels,
                                    fix_members=TRUE,fix_order=TRUE,fix_midpoint=FALSE,
                                    replace = TRUE, sampled_labels=sampled_labels
                                      )                                    
   cor_bakers_gamma_results[i] <- cor_bakers_gamma(dend_mixed1, dend_mixed2, warn = FALSE)
}

I am getting the following warning: It is impossible to produce a one-to-one cut for the k/h you specidied. 0's have been introduced. Note that this result would be different from R's default cutree output.It is impossible to produce a one-to-one cut for the k/h you specidied. 0's have been introduced. Note that this result would be different from R's default cutree output

I was hoping I could get some help with this warning and some information to solve it. Calculating cor_bakers_gamma() works with the original dendrograms and I'm also able to calculate a bootstrap p-value. However, I'm interested in calculating the 95% CI.

Thanks! Caitlin

talgalili commented 3 years ago

Hey Caitlin, Sorry - but I won't get to review this issue in the coming weeks. Just wanted to let you know. If you happen to solve it, please let me know.

T

On Mon, Feb 1, 2021 at 10:43 PM Caitlin Simopoulos notifications@github.com wrote:

I'm following your tutorial https://cran.r-project.org/web/packages/dendextend/vignettes/dendextend.html and am running into an error when I try to reproduce the 95% confidence interval of cor_bakers_gamma() results.

Specifically, I'm using this code chunk with my two own small dendrograms:

dend1 <- dend15dend2 <- dend51

set.seed(23801) R <- 100dend1_labels <- labels(dend1)dend2_labels <- labels(dend2)cor_bakers_gamma_results <- numeric(R)for(i in 1:R) { sampled_labels <- sample(dend1_labels, replace = TRUE) dend_mixed1 <- sample.dendrogram(dend1, dend_labels=dend1_labels, fix_members=TRUE,fix_order=TRUE,fix_midpoint=FALSE, replace = TRUE, sampled_labels=sampled_labels ) dend_mixed2 <- sample.dendrogram(dend2, dend_labels=dend2_labels, fix_members=TRUE,fix_order=TRUE,fix_midpoint=FALSE, replace = TRUE, sampled_labels=sampled_labels ) cor_bakers_gamma_results[i] <- cor_bakers_gamma(dend_mixed1, dend_mixed2, warn = FALSE) }

I am getting the following warning: It is impossible to produce a one-to-one cut for the k/h you specidied. 0's have been introduced. Note that this result would be different from R's default cutree output.It is impossible to produce a one-to-one cut for the k/h you specidied. 0's have been introduced. Note that this result would be different from R's default cutree output

I was hoping I could get some help with this warning and some information to solve it. Calculating cor_bakers_gamma() works with the original dendrograms and I'm also able to calculate a bootstrap p-value. However, I'm interested in calculating the 95% CI.

Thanks! Caitlin

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/talgalili/dendextend/issues/103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOJBU4G33E46Y66MZQNK3S44HATANCNFSM4W5OAXMQ .