R - reformat P value in ggplot using 'stat_compare_means'
问题 I want to plot the p values to each panel in a faceted ggplot. If the p value is larger than 0.05, I want to display the p value as it is. If the p value is smaller than 0.05, I want to display the value in scientific notation (i.e, 0.0032 -> 3.20e-3; 0.0000425 -> 4.25e-5). The code I wrote to do this is: p1 <- ggplot(data = CD3, aes(location, value, color = factor(location), fill = factor(location))) + theme_bw(base_rect_size = 1) + geom_boxplot(alpha = 0.3, size = 1.5, show.legend = FALSE)