0

geom_signif only applied to the first protein facet. The error message I get is "Warning: cannot compute exact p-value with ties"

ggplot(data = RecoveryStatistics, mapping = aes(x = Method, y = Recovery, fill = ProtChain))+
  geom_bar(stat = "identity", position = "dodge") + 
  geom_errorbar(aes(ymin = lower, ymax = upper), width=.2, position = position_dodge(.9))+
  facet_grid(ReplicateType~Protein)+
  scale_y_continuous(limits = c(0, 100))+
  labs(
    x = "Sample Method",
    y = "Recovery (%)" )+
  geom_signif(comparisons = list(c("Method1", "Method2"),
                                 c("Method2","Method3"),
                                 c("Method1", "Method3")),
              map_signif_level = TRUE,
              y_position = c(80,65,50))+
  theme_bw()+
  theme(axis.text.x = element_text(angle = 30,hjust = 1))

enter image description here

Previous to the above text, This was my code. The issue is that when I have geom_errorbars here, it doesn't separate the bars between the ProteinChains.

I understand that it is from the grouping, but I don't know how to go about having geom_signif comparing the methods but the geom_errorbars being in their respective lanes

ggplot(data = RecoveryStatistics, mapping = aes(x = SampleMethod, y = Recovery))+
  geom_bar(stat = "identity", position = "dodge", aes(fill = ProteinChain)) + 
  facet_grid(ReplicateType~Protein)+
  scale_y_continuous(limits = c(0, 100))+
  labs(
    x = "Sample Method",
    y = "Recovery (%)" )+
  geom_signif(comparisons = list(c("Method1", "Method2"),
                                 c("Method2","Method3"),
                                 c("Method1", "Method3"),
              map_signif_level = TRUE,
              y_position = c(80,65,50))+
  theme_bw()+
  theme(axis.text.x = element_text(angle = 30,hjust = 1))

enter image description here

Phil
  • 7,287
  • 3
  • 36
  • 66

0 Answers0