tukeyhsd

Consistent lettering across facets for Tukey letter plot on ggplot

不羁的心 提交于 2020-03-05 03:55:33
问题 I have followed the answer from this question: Tukey test results on geom_boxplot with facet_grid It is great, but what I would like is to compare the facets between them as well. In other words, letter order all of the results first then divide it into facets (I have both horizontal and vertical facets). How can I do this? Also, how can I reorder the letters to start from "a" in the first variable in the first facet, and then "b" the second variable and so on? I tried the following, and it

Tukey test results on geom_boxplot with facet_grid

ε祈祈猫儿з 提交于 2019-12-11 07:05:17
问题 I'd love to place letters representing the results of a Tukey's HSD on boxplots I make in ggplot. I am aware of other posts (Tukeys post-hoc on ggplot boxplot, Tukey's results on boxplot in R) but in my case, I work with facet_grid and I am not sure how to proceed. As I am creating a lot of boxplots, I would love to have something automated. Any tips to help me get me started would be greatly appreciated. Thanks a lot library(multcompView) library(ggplot2) #sample dataframe df <- data.frame