--
Check out our R resources at http://www.noamross.net/davis-r-users-group.html
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at http://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.
waf.m = melt(waf, id=c('dist','treat'), measure=c('n2o','wc','temp')) waf.sd = melt(waf, id=c('dist','treat'), measure=c('n2osd','wcsd','tempsd'))
waf. = cbind(waf.m,waf.sd[,'value']) #add only the sd to your data frame
colnames(waf.) = c(colnames(waf.m),'sd')
ggplot (waf., aes(dist, value, ymin=(value-sd), ymax=(value+sd), shape=treat)) +
geom_point (size=4) +
geom_errorbar (width=5) +
facet_grid(variable ~. ,scale="free_y")
One quick addendum: The newish cowplot package is a really helpful add-on to ggplot for arranging multiple plots, annotating them, and doing things like axis alignment. It has a number of helpful vignettes: https://cran.rstudio.com/web/packages/cowplot/index.html