0

I am looking for a way to add significance levels into my plots. My df is quite big, so I'll try to explain with an easier example:

data=all_data df1= data[data$column1 == 1,] df2 = data[data$column2 == 1,] other relevant columns:

  • color -> options: black, blue, red
  • income -> options: high, mid, low

my code looks like: ggplot()+ geom_boxplot(data=df1, aes(x=color, y=value_y)+ geom_boxplot(data=df2, aes(x=income, y=value_y)+ geom_signif(comparisons = list(c("black", "blue", map_signif_level=TRUE)

The idea is to compare all possible options, also in between different dataframes e.g. "black" and "high" or "blue" and "low". But even comparing in between the same df does not add p values to the graph.

Anyone any ideas?

also tried stat_comp_means: R console says TRUE but no significance level added to the boxplot

nestine98
  • 1
  • 1
  • 1
    If you can show a plain-text reproducible example of your data you are far more likely to get the help you need. – Allan Cameron Mar 21 '23 at 17:22
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Mar 21 '23 at 17:44

0 Answers0