## page was renamed from LanguageLab/Labmeeting/SP09w2 #acl HlpLabGroup:read,write,delete,revert,admin All:read #format wiki #language en = Graphing with {{{ggplot2}}} = This meeting will cover data visualization with {{{ggplot2}}}, a modern {{{R}}} graphics packages. This material will be based on a book by the author of this package, [[http://had.co.nz/ Hadley Wickham]]. The current version of {{{ggplot2}}} as of the writing of this tutorial is 0.8.2. Please make sure you are using at least this version. == {{{ggplot2}}} resources == * [[http://had.co.nz/ggplot2/ online help files]]: Supplement builtin R help files by providing graphical examples. Entire site can be downloaded for offline access. * [[http://had.co.nz/ggplot2/book/ ggplot2 book]]: Will be released by Spring this summer. Excellent resource on graphics, but also on strategies for data aggregation and code reuse. Highly recommended. * [[http://groups.google.com/group/ggplot2 ggplot2 discussion group]]: Polite friendly list, lots of code examples, quick responses (often from the author of the package). Best place to ask questions and report bugs. * [[http://rseek.org]]: best search site for help with R. (but, also try {{{RSiteSearch()}}}) == Basic plots == * {{{qplot}}} For all of the above plots, we'll discuss the use of panels (or facets) and groups in plots. == Labels, annotation, and appearance == We'll talk about how to add legends, keys, text, titles, and other explanatory elements to plots. We'll also cover ways to define colors and color schemes. Finally, we'll talk about changing the appearance of text elements (fonts and sizes). The creation of themes will be introduced, but not covered in detail. == Custom plotting functions == If time permits, we'll discuss ways to build up customized plotting functions using both packages. For {{{ggplot2}}}, this means learning about geoms, stats, and scales. == Tutorial code == Check back before the meeting to download a script that will contain all of the R code used in the tutorial. [[attachment:ggplot2_tut.R]] You can keep track of updates to this and my other tutorials at [[http://github.com/aufrank/tutorials/tree/master]]. == Comments and questions == If there's anything in particular you'd like to see covered, or any questions you want answered, feel free to record them here.