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