Overview
0.0.1 base
graphics
The base
and graphics
packages provide users the ability to create and customize a large number of different plot types. Base graphics are a very powerful system for creating 2-D and 3-D graphics and provide a nearly inifinite number of customization options.
0.0.2 ggplot2
graphics
The ggplot2 package, created by Hadley Wickham, offers a powerful graphics syntax for creating elegant and complex plots. Its popularity in the R community has exploded in recent years. Originally based on Leland Wilkinson’s The Grammar of Graphics, ggplot2 allows you to create customized graphs tailored to your problem by building the plots with layers.
ggplot2
tries to take the good parts of base
and lattice
graphics and none of the bad parts that can make plotting a hassle. You feed ggplot2 your data, then apply a series of mappings and transformations to create a visual representation of that data. A ggplot2 graph is built up from a few basic elements:
Data The raw data that you want to plot
Geometries
geom_
The geometric shapes that will represent the data.Aethetics
aes()
Aesthetics of the geometric and statistical objects, such as color, size, shape and position.Scales
scale_
Maps between the data and the aesthetic dimensions, such as data range to plot width or factor values to colorsStatistical transformations
stat_
Statistical summaries of the data that can be plotted, such as quantiles, fitted curves (loess, linear models, etc.), sums and so on.Coordinate systems
coord_
The transformation used for mapping data coordinates into the plane of the data rectangle.Facets
facet_
The arrangement of the data into a grid of plots (also known as latticing, trellising or creating small multiples).Visual Themes The overall visual defaults of a plot: background, grids, axe, default typeface, sizes, colors, etc.
0.0.3 lattice
graphics
The lattice
package was developed by Deepayan Sarkar to implement Trellis graphics (originally developed for S and S-PLUS) in R. Lattice is a powerful and elegant high-level data visualization system, with an emphasis on multivariate data, that is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. Lattice simplifies high-level plotting tasks and has a syntax that is similar to base R graphics