Remarks, Tipps & Resources
Using ggplot2 in Loops and Functions
The grid-based graphics functions in lattice
and ggplot2
create a graph object. When you use these functions interactively at the command line, the result is automatically printed. However, when using source()
or inside your own functions, you will need an explicit print()
statement, i.e., print(g)
in most of our examples. For more information, see also the R FAQ page.
Additional Resources
- “ggplot2: Elegant Graphics for Data Analysis” by Hadley Wickham, available via open-access!
- “Fundamentals of Data Visualization” by Claus O. Wilke about data visualization in general but using
{ggplot2}
. (You can find the codes on his GitHub profile.) - “Cookbook for R” by Winston Chang with recipes to produce R plots
- Gallery of the Top 50 ggplot2 visualizations
- Gallery of
{ggplot2}
extension packages - How to extend
{ggplot2}
by Hadley Wickham - The fantastic R4DS Online Learning Community that offers help and mentoring for all things related to the content of the “R for Data Science” book by Hadley Wickham
- #TidyTuesday, a weekly social data project focusing on ggplots—check also #TidyTuesday on Twitter and this collection of contributions by Neil Grantham
- A two-part, 4.5-hours tutorial series by Thomas Linn Pedersen (Part 1 | Part 2)