This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R "stat_compare_means" pairwaise comparison

Hi, I am trying to solve the problem of

stat_compare_means

The source code here

lev <- levels(div_df_melt$Location) # get the variables

L.pairs <- combn(seq_along(lev), 2, simplify = FALSE, FUN = function(i) lev[i])

pval <- list(
  cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 0.1, 1),
  symbols = c("****", "***", "**", "*", "n.s")
)

p2 <- p + stat_compare_means(
  comparisons = L.pairs,
  label = "p.signif",
  symnum.args = list(
    cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 0.1, 1),
    symbols = c("****", "***", "**", "*", "n.s")
  )
)

print(p2)

But lev <- levels(div_df_melt$Location) # get the variables

L.pairs <- combn(seq_along(lev), 2, simplify = FALSE, FUN = function(i) lev[i])

didn't work properly.

Your assistance is highly appreciated.

r

0 answers

No answers yet.

Log in to answer this question.