Entering edit mode

4 days ago

MSRS
▴
530

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.