![](http://image.absoluteastronomy.com/images//topicimages/noimage.gif)
Ggplot2
Encyclopedia
ggplot2 is a data visualization
Data visualization
Data visualization is the study of the visual representation of data, meaning "information that has been abstracted in some schematic form, including attributes or variables for the units of information"....
package for the statistical programming
Computational statistics
Computational statistics, or statistical computing, is the interface between statistics and computer science. It is the area of computational science specific to the mathematical science of statistics....
language R
R (programming language)
R is a programming language and software environment for statistical computing and graphics. The R language is widely used among statisticians for developing statistical software, and R is widely used for statistical software development and data analysis....
. Created by Hadley Wickham in 2005, ggplot2 as an implementation of Leland Wilkinson
Leland Wilkinson
Leland Wilkinson is a statistician and computer scientist at SYSTAT Software Inc. Dr. Wilkinson developed SYSTAT in the early 1980s, sold it to SPSS in 1995, and now serves as Executive VP of SYSTAT Software Inc. in Chicago. His research focuses on scientific visualization and statistical...
's Grammar of Graphics--a general scheme for data visualization which breaks up graph into semantic components such as scales and layers. ggplot2 can serve as a replacement for the base graphics in R and contains a number of defaults for web and print display of common scales. Since 2005, ggplot2 has grown in use to become one of the more popular R packages.
Comparison with base graphics and other packages
In contrast to base R graphics, ggplot2 allows the user to add, remove or alter components in a plot at a high level of abstraction. This abstraction comes at a cost, with ggplot2 approximately 7 times slower than lattice graphics.One potential limitation of base R graphics is the "pen-and-paper model" utilized to populate the plotting device. Graphical output from the interpreter is added directly to the plotting device or window rather than separately for each distinct element of a plot. In this respect it is similar to the lattice package, though Wickham argues ggplot2 inherits a more formal model of graphics from Wilkinson. As such it allows for a high degree of modularity; the same underlying data can be transformed by many different scales or layers.
Plots may be created via the convenience function
qplot
where arguments and defaults are meant to be similar to base R's plot
function. More complex plotting capacity is available via ggplot
which exposes the user to more explicit elements of the grammar.External links
- Example code and documentation
- Repository on GithubGithubGitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both commercial plans and free accounts for open source projects...
- ggplot2 package on CRAN