Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 544
K_081 Avatar asked Oct 20 '25 10:10

K_081


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.

like image 72
kt.leap Avatar answered Oct 21 '25 23:10

kt.leap



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!