title: One way ANOVA: post-hoc comparison "adding letters to graph"
body: <p>I am working on a project for one of my classes and cannot figure out how to obtain the letters for treatment comparisons after using the tukeyHSD post-hoc test.</p>
  
  <p>Is there a simple way to do this?</p>
  
  <p>Here is my code:</p>
  
  <p>Boulder study</p>
  
  <pre><code>rm(list=ls())
  getwd()
  setwd('/Volumes/9163980664/GIS/Boulder_Field/CSV_files')
  list.files()
  bodega &lt;- read.table('biotic_stats.csv', sep=',', h=T)
  head(bodega[,1:5])
  length(bodega$Face[bodega$Face=='E'])
  length(bodega$Face[bodega$Face=='N'])
  length(bodega$Face[bodega$Face=='S'])
  length(bodega$Face[bodega$Face=='W'])
  </code></pre>
  
  <p>One way ANOVA</p>
  
  <pre><code>boulder_face &lt;- bodega$Face
  proportion_rockweed &lt;- bodega$Pelvetiopsis_prop_cover_
  </code></pre>
  
  <p>Barplot</p>
  
  <pre><code>setwd('/Volumes/9163980664/GIS/Boulder_Field/R_code_graphs_stats')
  ylab = 'Rockweed Proportion'
  xlab = 'Face of Boulder'
  graphics.off(); quartz(width=4, height=4); par(mai=c(1.2,1.2,.3,.5), cex=1.4)
  plot(proportion_rockweed ~ boulder_face, data=bodega, col="grey", ylab=ylab, xlab=xlab)
  dev.print(png, file = "Bodega_Rockweed_boxplot.png", wid = 480, height = 480)
  </code></pre>
  
  <p>ANOVA</p>
  
  <pre><code>bodega.anova &lt;- aov(proportion_rockweed ~ boulder_face, data = bodega)
  summary(bodega.anova)
  TukeyHSD(bodega.anova)
  help(aov)
  </code></pre>
  
  <p>here is what i have tried</p>
  
  <pre><code>TukeyHSD(bodega.anova)
  quartz(width=4, height=4); par(mai=c(1.2,1.2,1,1), cex=1)
  plot(TukeyHSD(bodega.aov))
  bodega.anova &lt;- aov(proportion_rockweed ~ boulder_face, data = bodega)
  
  library(multcompView)
  multcompLetters(extract_p(TukeyHSD(bodega.anova)))
  </code></pre>