Learn R Programming

⚠️There's a newer version (3.5.0) of this package.Take me there.

ggplot2 (version 0.9.0)

An implementation of the Grammar of Graphics

Description

An implementation of the grammar of graphics in R. It combines the advantages of both base and lattice graphics: conditioning and shared axes are handled automatically, and you can still build up a plot step by step from multiple data sources. It also implements a sophisticated multidimensional conditioning system and a consistent interface to map data to aesthetic attributes. See the ggplot2 website for more information, documentation and examples.

Copy Link

Version

Install

install.packages('ggplot2')

Monthly Downloads

1,879,771

Version

0.9.0

License

GPL-2

Maintainer

Last Published

March 1st, 2012

Functions in ggplot2 (0.9.0)

benchplot

Benchmark plot creation time. Broken down into construct, build, render and draw times.
stat_abline

Add a line with slope and intercept.
coord_fixed

Cartesian coordinates with fixed relationship between x and y scales.
coord_cartesian

Cartesian coordinates.
coord_map

Map projections.
coord_polar

Polar coordinates.
absoluteGrob

Absolute grob
cut_interval

Cut numeric vector into intervals of equal length.
aes_position

Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yend
annotation_custom

Annotation: Custom grob.
coord_flip

Flipped cartesian coordinates.
continuous_scale

Continuous scale constructor.
geom_raster

High-performance rectangular tiling.
ggstructure

A plot which aims to reveal gross structural anomalies in the data.
label_both

Label facets with value and variable.
geom_hex

Hexagon bining.
facet

Facet specification.
geom_freqpoly

Frequency polygon.
opts

Set options/theme elements for a single plot
ggplotGrob

Generate a ggplot2 plot grob.
geom_errorbarh

Horizontal error bars
geom_line

Connect observations, ordered by x value.
fortify.lm

Supplement the data fitted to a linear model with model fit statistics.
geom_map

Polygons from a reference map.
geom_crossbar

Hollow bar with middle indicated by horizontal line.
aes_string

Generate aesthetic mappings from a string
geom_errorbar

Error bars.
facet_null

Facet specification: a single panel.
autoplot

Create a complete ggplot appropriate to a particular data type
scale_colour_brewer

Sequential, diverging and qualitative colour scales from colorbrewer.org
geom_smooth

Add a smoothed conditional mean.
geom_abline

Line specified by slope and intercept.
geom_histogram

Histogram
diamonds

Prices of 50,000 round cut diamonds
fortify.map

Fortify method for map objects.
fortify-multcomp

Fortify methods for objects produced by multcomp
geom_vline

Line, vertical.
geom_segment

Single line segments.
ggplot.data.frame

Create a new ggplot plot from a data frame
hmisc

expand_limits

Expand the plot limits with data.
ggmissing

Create a plot to illustrate patterns of missing values.
ggplot

Create a new ggplot plot
aes_group_order

Aesthetics: group, order
geom_jitter

Points, jittered to reduce overplotting.
ggplot2

ggplot2.
+.ggplot

Modify a plot by adding on new components.
geom_area

Area plot.
stat_contour

Calculate contours of 3d data.
annotation_raster

Annotation: High-performance rectangular tiling.
aes_all

Given a character vector, create a set of identity mappings
fortify

Fortify a model with data.
geom_boxplot

Box and whiskers plot.
geom_ribbon

Ribbons, y range with continuous x values.
mean_se

Calculate mean and standard errors on either side.
geom_dotplot

Dot plot
ggpcp

Make a parallel coordinates plot.
position_fill

Stack overlapping objects on top of one another, and standardise to have equal height.
scale_size_continuous

Size scale.
stat_qq

Calculation for quantile-quantile plot.
position_dodge

Adjust position by dodging overlaps to the side.
annotate

Annotate a plot
geom_tile

Tile plane with rectangles.
last_plot

Retrieve the last plot to be modified or created.
update_geom_defaults

Modify geom/stat aesthetic defaults for future plots
cweave

Col weave
geom_step

Connect observations by stairs.
scale_x_date

Position scale, date
limits

Generate correct scale type for specified limits
aes_colour_fill_alpha

Colour related aesthetics: colour, fill and alpha
guide_legend

Legend guide.
mpg

Fuel economy data from 1999 and 2008 for 38 popular models of car
ggscale

Components of a scale:
discrete_scale

Discrete scale constructor.
ggorder

A plot to investigate the order in which observations were recorded.
geom_hline

Horizontal line.
scale_colour_manual

Create your own discrete scale.
geom_blank

Blank, draws nothing.
geom_pointrange

An interval represented by a vertical line, with a point in the middle.
coord

New coordinate system.
stat_function

Superimpose a function.
annotation_map

Annotation: maps.
is.coord

Is this object a coordinate system?
geom_rect

2d rectangles.
geom_linerange

An interval represented by a vertical line.
facet_grid

Lay out panels in a grid.
translate_qplot_ggplot

Translating between qplot and ggplot
geom_point

Points, as for a scatterplot
theme_blank

Theme element: blank. This theme element draws nothing, and assigns no space
geom_bin2d

Add heatmap of 2d bin counts.
guides

Set guides for each scale.
theme_text

Theme element: text.
scale_colour_gradientn

Smooth colour gradient between n colours
map_data

Create a data frame of map data.
update_element

Update theme param
stat_summary_hex

Apply funciton for 2D hexagonal bins.
seals

Vector field of seal movements.
print.ggplot

Draw plot on current graphics device.
waiver

A waiver object.
scale_alpha

Alpha scales.
scale_x_continuous

Continuous position scales (x & y).
midwest

Midwest demographics.
movies

Movie information and user ratings from IMDB.com.
stat_summary2d

Apply funciton for 2D rectangular bins.
ggsave

Save a ggplot with sensible defaults
stat_unique

Remove duplicates.
stat_vline

Add a vertical line
translate_qplot_base

Translating between qplot and base graphics
aes_linetype_size_shape

Differentiation related aesthetics: linetype, size, shape
scale_x_datetime

Position scale, date
msleep

An updated and expanded version of the mammals sleep dataset.
coord_trans

Transformed cartesian coordinate system.
layer

Create a new layer
summary.ggplot

Displays a useful description of a ggplot object
stat_smooth

Add a smoother.
aes_auto

Automatic aesthetic mapping
label_value

Label facets with their value. This is the default labelling scheme.
should_stop

Used in examples to illustrate when errors should occur.
scale_area

Scale area instead of radius (for size).
fortify.sp

Fortify method for classes from the sp package.
qplot

Quick plot
scale_linetype

Scale for line patterns.
presidential

Terms of 10 presidents from Eisenhower to Bush W.
translate_qplot_gpl

Translating between qplot and Graphics Production Library (GPL)
stat_ydensity

1d kernel density estimate along y axis, for violin plot.
stat_hline

Add a horizontal line
xlim

Convenience function to set the limits of the x axis.
labs

Change axis labels and legend titles
stat_quantile

Continuous quantiles.
resolution

Compute the "resolution" of a data vector.
scale_colour_identity

Use values without scaling.
ggplot_gtable

Build a plot with all the usual bits and pieces.
zeroGrob

The zero grob draws nothing and has zero size.
scale_colour_grey

Sequential grey colour scale.
stat_identity

Identity statistic.
label_bquote

Label facet with 'bquoted' expressions
geom_density2d

Contours from a 2d density estimate.
geom_contour

Display contours of a 3d surface in 2d.
scale_shape

Scale for shapes, aka glyphs.
stat_boxplot

Calculate components of box and whisker plot.
theme_update

Get, set and update themes.
theme_rect

Theme element: rectangle.
theme_segment

Theme element: segments.
cut_number

Cut numeric vector into intervals containing equal number of points.
plotmatrix

Code to create a scatterplot matrix (experimental)
stat_summary

Summarise y values at every unique x.
geom_text

Textual annotations.
my_plot

Create a plot.
scale_x_discrete

Discrete position.
ggfluctuation

Create a fluctuation plot.
update_labels

Update axis/legend labels
geom_rug

Marginal rug plots.
stat_bin2d

Count number of observation in rectangular bins.
theme_line

Theme element: line.
stat_bindot

Bin data for dot plot.
position_stack

Stack overlapping objects on top of one another.
stat_spoke

Convert angle and radius to xend and yend.
theme_grey

A theme with grey background and white gridlines.
scale_colour_gradient2

Diverging colour gradient
geom_quantile

Add quantile lines from a quantile regression.
translate_qplot_lattice

Translating between qplot and lattice
geom_bar

Bars, rectangles with bases on x-axis
borders

Create a layer of map borders.
geom_density

Display a smooth density estimate.
ylim

Convenience function to set the limits of the y axis.
ggplot_build

Build ggplot for rendering.
is.facet

Is this object a facetting specification?
position_jitter

Jitter points to avoid overplotting.
position_identity

Don't adjust position
stat_sum

Sum unique values. Useful for overplotting on scatterplots.
geom_path

Connect observations in original order
stat_binhex

Bin 2d plane into hexagons.
interleave

Interleave (or zip) multiple vectors into a single vector.
aes

Generate aesthetic mappings that describe how variables in the data are mapped to visual properties (aesthetics) of geoms.
rweave

Row weave.
gtable

Create a new table grid.
geom_violin

Violin plot.
scale_colour_gradient

Smooth gradient between two colours
theme_bw

A theme with white background and black gridlines.
stat_density2d

2d density estimation.
stat_bin

Bin data.
stat_density

1d kernel density estimate.
economics

US economic time series.
facet_wrap

Wrap a 1d ribbon of panels into 2d.
geom_polygon

Polygon, a filled path.
guide_colourbar

Contiuous colour bar guide.
label_parsed

Label facets with parsed label.
scale_colour_hue

Qualitative colour scale with evenly spaced hues.