Problem with R code: Computation failed in `stat_signif()`: not enough 'y' observations

Viewed 1640

I am trying to compare two groups with 47 observations in each and tried to include the significance level using ggsignif but it gives me this error message : Computation failed in stat_signif(): not enough 'y' observations This is the data :enter image description here

The first group being "Un-C_SL" / "Un-C_RL" / "Un-C" and the second one that doesn't appear in the image is "Vp_SL" / "Vp_RL" / "Vp"

This is the code I used:

ggplot(UnC_Vp_2, aes(x = Condition, y = Biomass)) + geom_boxplot() + geom_signif(comparisons = list("Un-C", "Vp"), map_signif_level = TRUE)

I was able to get the box plot but not the significance level. What should I do?

1 Answers

The comparisons = argument needs a list() of pairwise comparisons that are each contained in a c(), so it should work if you change it to comparisons = list(c("Un-C", "Vp")).

See this github issue also. I found this question when I had the same problem; I had forgotten it needed to be a list and not just c() and I agree that a more informative error message would help.

Related