
Create Elegant Data Visualisations Using the Grammar of Graphics …
ggplot2 is a system for declaratively creating graphics, based on The Grammar of Graphics. You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to …
Introduction to ggplot2
ggplot2 is an R package for producing visualizations of data. Unlike many graphics packages, ggplot2 uses a conceptual framework based on the grammar of graphics. This allows you to …
Package index - ggplot2
All ggplot2 plots begin with a call to ggplot(), supplying default data and aesthetic mappings, specified by aes(). You then add layers, scales, coords and facets with +. To save a plot to …
Create a new ggplot — ggplot • ggplot2
ggplot() initializes a ggplot object. It can be used to declare the input data frame for a graphic and to specify the set of plot aesthetics intended to be common throughout all subsequent layers …
ggplot2: Create Elegant Data Visualisations Using the Grammar of ...
A system for 'declaratively' creating graphics, based on "The Grammar of Graphics". You provide the data, tell 'ggplot2' how to map variables to aesthetics, what graphical primitives to use, and …
Set scale limits — lims • ggplot2
This is a shortcut for supplying the limits argument to the individual scales. By default, any values outside the limits specified are replaced with NA. Be warned that this will remove data outside …
Aesthetic specifications - ggplot2
In addition, ggplot2 provides a conversion factor as the variable .pt, so if you want to draw 12pt text, you can also set size = 12 / .pt.
Modify axis, legend, and plot labels — labs • ggplot2
Good labels are critical for making your plots accessible to a wider audience. Always ensure the axis and legend labels display the full variable name. Use the plot title and subtitle to explain …
Using ggplot2 in packages
Programming with ggplot2 within a package adds several constraints, particularly if you would like to submit the package to CRAN. In particular, programming within an R package changes the …
Layer position adjustments — layer_positions - ggplot2
In ggplot2, a plot is constructed by adding layers to it. In addition to geoms and stats, position adjustments are the third required part of a layer. The 'position' part of a layer is responsible …