
ggplot2 - Create Elegant Data Visualisations Using the Grammar …
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 +.
Bar charts — geom_bar • ggplot2
Thus, ggplot2 will by default try to guess which orientation the layer should have. Under rare circumstances, the orientation is ambiguous and guessing may fail. In that case the orientation …
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 …
Points — geom_point • ggplot2
Aesthetics geom_point() understands the following aesthetics. Required aesthetics are displayed in bold and defaults are displayed for optional aesthetics: ... The fill aesthetic only applies to …
Construct aesthetic mappings — aes • ggplot2
See also vars() for another quoting function designed for faceting specifications. Run vignette("ggplot2-specs") to see an overview of other aesthetics that can be modified. Delayed …
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 …
Text — geom_label • ggplot2
Aesthetics geom_text() understands the following aesthetics. Required aesthetics are displayed in bold and defaults are displayed for optional aesthetics: ... Learn more about setting these …
Create a layer of map borders — annotation_borders • ggplot2
This is a quick and dirty way to get map data (from the maps package) onto your plot. This is a good place to start if you need some crude reference lines, but you'll typically want something …