Learn R Programming

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

ggplot2 (version 1.0.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,795,971

Version

1.0.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

May 21st, 2014

Functions in ggplot2 (1.0.0)

facet_null

Facet specification: a single panel.
aes_colour_fill_alpha

Colour related aesthetics: colour, fill and alpha
geom_density

Display a smooth density estimate.
is.ggplot

Reports whether x is a ggplot object
aes_group_order

Aesthetics: group, order
geom_density2d

Contours from a 2d density estimate.
fortify.map

Fortify method for map objects.
element_line

Theme element: line.
coord_trans

Transformed cartesian coordinate system.
plot-templates

Plot templates.
label_bquote

Label facet with 'bquoted' expressions
geom_hex

Hexagon bining.
geom_path

Connect observations in original order
is.rel

Reports whether x is a rel object
aes_linetype_size_shape

Differentiation related aesthetics: linetype, size, shape
position_fill

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

Set the default expand values for the scale, if NA
aes_string

Generate aesthetic mappings from a string/quoted objects
geom_rect

2d rectangles.
mean_se

Calculate mean and standard errors on either side.
ggplot_build

Build ggplot for rendering.
scale_colour_grey

Sequential grey colour scale.
ggplot.data.frame

Create a new ggplot plot from a data frame
scale_colour_gradientn

Smooth colour gradient between n colours
add_theme

Modify properties of an element in a theme object
coord

New coordinate system.
element_text

Theme element: text.
cut_number

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

Add a line with slope and intercept.
coord_flip

Flipped cartesian coordinates.
cut_interval

Cut numeric vector into intervals of equal length.
ggscale

Components of a scale:
facet_grid

Lay out panels in a grid.
geom_smooth

Add a smoothed conditional mean.
coord_quickmap

Cartesian coordinates with an aspect ratio approximating Mercator projection.
stat_sum

Sum unique values. Useful for overplotting on scatterplots.
geom_pointrange

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

Build a theme (or partial theme) from theme elements
ggplot2

ggplot2.
print.ggplot

Draw plot on current graphics device.
is.coord

Is this object a coordinate system?
should_stop

Used in examples to illustrate when errors should occur.
last_plot

Retrieve the last plot to be modified or created.
presidential

Terms of 10 presidents from Eisenhower to Bush W.
scale_x_date

Position scale, date
geom_crossbar

Hollow bar with middle indicated by horizontal line.
stat_boxplot

Calculate components of box and whisker plot.
geom_freqpoly

Frequency polygon.
scale_colour_brewer

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

Annotation: maps.
geom_raster

High-performance rectangular tiling.
coord_cartesian

Cartesian coordinates.
autoplot

Create a complete ggplot appropriate to a particular data type
annotation_logticks

Annotation: log tick marks
continuous_scale

Continuous scale constructor.
absoluteGrob

Absolute grob
element_blank

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

Bin data.
stat_smooth

Add a smoother.
stat_ellipse

Plot data ellipses.
element_rect

Theme element: rectangle.
geom_line

Connect observations, ordered by x value.
annotation_custom

Annotation: Custom grob.
is.facet

Is this object a facetting specification?
stat_identity

Identity statistic.
geom_errorbarh

Horizontal error bars
geom_hline

Horizontal line.
geom_dotplot

Dot plot
label_value

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

Fortify method for classes from the sp package.
geom_step

Connect observations by stairs.
geom_polygon

Polygon, a filled path.
stat_unique

Remove duplicates.
geom_linerange

An interval represented by a vertical line.
geom_bin2d

Add heatmap of 2d bin counts.
midwest

Midwest demographics.
+.gg

Modify a ggplot or theme object by adding on new components.
geom_rug

Marginal rug plots.
guides

Set guides for each scale.
geom_jitter

Points, jittered to reduce overplotting.
msleep

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

Legend guide.
position_stack

Stack overlapping objects on top of one another.
scale_x_continuous

Continuous position scales (x & y).
expand_limits

Expand the plot limits with data.
translate_qplot_gpl

Translating between qplot and Graphics Production Library (GPL)
scale_x_discrete

Discrete position.
geom_segment

Single line segments.
geom_tile

Tile plane with rectangles.
stat_ecdf

Empirical Cumulative Density Function
scale_colour_hue

Qualitative colour scale with evenly spaced hues.
labs

Change axis labels and legend titles
benchplot

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

Create a new layer
scale_colour_gradient

Smooth gradient between two colours
scale_linetype

Scale for line patterns.
facet_wrap

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

Box and whiskers plot.
position_dodge

Adjust position by dodging overlaps to the side.
scale_colour_gradient2

Diverging colour gradient
borders

Create a layer of map borders.
rel

Relative sizing for theme elements
gg_dep

Give a deprecation error, warning, or messsage, depending on version number.
stat_hline

Add a horizontal line
hmisc

ggtheme

ggplot2 themes
interleave

Interleave (or zip) multiple vectors into a single vector.
fortify-multcomp

Fortify methods for objects produced by multcomp
scale_area

Scale area instead of radius (for size).
aes

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

Col weave
fortify

Fortify a model with data.
geom_blank

Blank, draws nothing.
annotation_raster

Annotation: High-performance rectangular tiling.
geom_ribbon

Ribbons, y range with continuous x values.
diamonds

Prices of 50,000 round cut diamonds
scale_x_datetime

Position scale, date
stat_density2d

2d density estimation.
rweave

Row weave.
seals

Vector field of seal movements.
scale_identity

Use values without scaling.
scale_size_area

Scale area instead of radius, for size.
stat_binhex

Bin 2d plane into hexagons.
coord_map

Map projections.
geom_errorbar

Error bars.
limits

Generate correct scale type for specified limits
stat_quantile

Continuous quantiles.
geom_quantile

Add quantile lines from a quantile regression.
stat_density

1d kernel density estimate.
stat_summary_hex

Apply funciton for 2D hexagonal bins.
geom_point

Points, as for a scatterplot
position_jitter

Jitter points to avoid overplotting.
coord_fixed

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

Facet specification.
geom_area

Area plot.
geom_violin

Violin plot.
position_jitterdodge

Adjust position by simultaneously dodging and jittering
scale_shape

Scale for shapes, aka glyphs.
geom_bar

Bars, rectangles with bases on x-axis
stat_bin2d

Count number of observation in rectangular bins.
scale_size

Size scale.
theme_blank

Deprecated theme_xx functions
label_wrap_gen

Label facets with a word wrapped label.
discrete_scale

Discrete scale constructor.
scale_alpha

Alpha scales.
is.theme

Reports whether x is a theme object
zeroGrob

The zero grob draws nothing and has zero size.
stat_qq

Calculation for quantile-quantile plot.
ggplot

Create a new ggplot plot
map_data

Create a data frame of map data.
theme_update

Get, set and update themes.
update_geom_defaults

Modify geom/stat aesthetic defaults for future plots
stat_summary2d

Apply funciton for 2D rectangular bins.
update_element

Update theme param
position_identity

Don't adjust position
geom_map

Polygons from a reference map.
translate_qplot_ggplot

Translating between qplot and ggplot
stat_summary

Summarise y values at every unique x.
labeller

Generic labeller function for facets
translate_qplot_lattice

Translating between qplot and lattice
update_labels

Update axis/legend labels
translate_qplot_base

Translating between qplot and base graphics
aes_auto

Automatic aesthetic mapping
my_plot

Create a plot.
resolution

Compute the "resolution" of a data vector.
geom_text

Textual annotations.
stat_ydensity

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

Set theme elements
aes_all

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

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

US economic time series.
calc_element

Calculate the element properties, by inheriting properties from its parents
fortify.lm

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

Label facets with parsed label.
mpg

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

Convert angle and radius to xend and yend.
waiver

A waiver object.
stat_bindot

Bin data for dot plot.
stat_function

Superimpose a function.
coord_polar

Polar coordinates.
geom_abline

Line specified by slope and intercept.
ggplotGrob

Generate a ggplot2 plot grob.
label_both

Label facets with value and variable.
movies

Movie information and user ratings from IMDB.com.
geom_contour

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

Quick plot
stat_contour

Calculate contours of 3d data.
xlim

Convenience functions to set the limits of the x and y axis.
annotate

Create an annotation layer.
geom_vline

Line, vertical.
geom_histogram

Histogram
ggplot_gtable

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

Save a ggplot with sensible defaults
guide_colourbar

Continuous colour bar guide.
scale_manual

Create your own discrete scale.
stat_vline

Add a vertical line
summary.ggplot

Displays a useful description of a ggplot object