Computation failed in `stat_signif()`: missing value where TRUE/FALSE needed/not enough 'y' values

I am sorry, for the last post. Linking back to my question while I am trying to compare significance between obtained values for example:

ggplot(Acetylcholine3, aes( x = Concentration, y = Change, outlier.alpha = 0.1))+
              geom_boxplot(width=0.2,notch = FALSE) +
              ggtitle("Comparison of different concentrations of Acetylcholine") +
              geom_violin(fill = "#5e99ff")+
              geom_boxplot(width=0.2)+
        labs(x = expression(paste("Concentration")),
             y = expression(paste("Heart   Beat"))) +
        geom_point() +
        labs(x = expression(paste("Concentration"))) +
                  geom_boxplot(width=0.2)+
                  ylim(0,300)+
                  *stat_compare_means(comparisons = list(c("Acetylcholine 1x10-7", "Control"), c("Control", "Acetylcholine 1x10-6"),  c("Control", "Acetylcholine  1x10-5"),label = "p.signif"))*

I am getting that error -> Computation failed in stat_signif(): missing value where TRUE/FALSE needed

or, when using this code:

ggplot(Acetylcholine3, aes( x = Concentration, y = Change, outlier.alpha = 0.1))+
              geom_boxplot(width=0.2,notch = FALSE) +
              ggtitle("Comparison of different concentrations of Acetylcholine") +
              geom_violin(fill = "#5e99ff")+
              geom_boxplot(width=0.2)+
        labs(x = expression(paste("Concentration")),
             y = expression(paste("Heart   Beat"))) +
        geom_point() +
        labs(x = expression(paste("Concentration"))) +
                  geom_boxplot(width=0.2)+
                  ylim(0,300)+
                  *geom_signif(comparisons = list(c("Control", "Acetylcholine 1x10-3")),map_signif_level = TRUE, y_position = c(260), colour = "#cf1b1b")*

I am getting this error:


Unfortunately, I cannot find any solution. I am guessing that the R does not see something.

As a note, it is extremely hard to help debug code and/or error messages when screenshots are posted. Posting screenshots, instead of actual code/error messages, is likely to decrease your chances of getting the help you are looking for in general. Instead of posting a screenshot, please copy and paste the code and error message and format the pasted code/error messages as shown below.

Put code that is inline (such as a function name, like mutate or filter ) inside of backticks ( mutate ) and chunks of code (including error messages and code copied from the console) can be put between sets of three backticks:

```
example <- foo %>%
  filter(a == 1)
```

This process can be done automatically by highlighting your code, either inline or in a chunk, and clicking the </> button on the toolbar of the reply window!

This will help keep our community tidy and help you get the help you are looking for!

For more information, please take a look at the community's FAQ on formating code

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.