
Create Elegant Data Visualisations Using the Grammar of Graphics
However, in most cases you start with ggplot(), supply a dataset and aesthetic mapping (with aes()). You then add on layers (like geom_point() or geom_histogram()), scales (like …
Introduction to ggplot2
As the first step in many plots, you would pass the data to the ggplot() function, which stores the data to be used later by other parts of the plotting system.
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 aesthetic mappings for the plot, intended to be common throughout all …
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 +.
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 …
Construct aesthetic mappings — aes • ggplot2
Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Aesthetic mappings can be set in ggplot() and in individual layers.
Modify axis, legend, and plot labels — labs • ggplot2
alt, alt_insight Text used for the generation of alt-text for the plot. See get_alt_text for examples. alt can also be a function that takes the plot as input and returns text as output. alt also …
Aesthetic specifications • ggplot2
sizes <- expand.grid (size = (0:3) * 2, stroke = (0:3) * 2) ggplot (sizes, aes (size, stroke, size = size, stroke = stroke)) + geom_abline (slope = -1, intercept = 6, colour = "white", linewidth = 6) …
Using ggplot2 in packages
If changes in ggplot2 or your code introduce a change in the visual output of a ggplot, tests will fail when you run them locally or as part of a Continuous Integration setup.
Points — geom_point • ggplot2
If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot(). A data.frame, or other object, will override the plot data.