Sig. letters will not show up on box plot in R

29 Views Asked by At
   WD.fit<-emmeans(WD.mod,~POST*PLANTING.DATE)
   WD.fit
   WD.cld<-cld(WD.fit,decreasing=TRUE,adjust='Tukey',Letters=LETTERS,reversed = T)#gives the letters 
   WD.cld

   anova <- aov(DENSITY ~ POST+PLANTING.DATE+POST*PLANTING.DATE, data = WDat56DAPOST)
   summary(anova)

   tukey <- TukeyHSD(anova)
   print(tukey)
   cld <- multcompLetters4(anova, tukey)
   print(WD.cld)


    ggplot(WDat56DAPOST) +
     aes(x = POST, y = DENSITY, fill = PLANTING.DATE) +
    geom_boxplot(coef=0,outlier.shape = NA) +
     scale_fill_hue(direction = 1) +
     labs(x = "POST", y = "DENSITY", title = "Weed Density 28 Days After First POST") +
     theme_classic() +
     theme(plot.title = element_text(size = 16L, face = "bold", hjust = 0.5), axis.title.y =  
     element_text(size = 12L, face = "bold"), axis.title.x = element_text(size = 12L, face = "bold"))
    geom_text(data = WD.cld, aes(x = POST, y = DENSITY, label = cld)

geom_text code did not work

0

There are 0 best solutions below