Content deleted Content added
Steveharoz (talk | contribs) |
|||
Line 51:
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.<ref>{{cite web|last=Smith|first=David|title=Create beautiful statistical graphics with ggplot2|url=http://blog.revolutionanalytics.com/2009/01/create-beautiful-statistical-graphics-with-ggplot2.html|work=Revolutions|publisher=[[Revolution Analytics]]|access-date=11 July 2011}}</ref> This abstraction comes at a cost, with ggplot2 being slower than lattice graphics.<ref>{{cite web|url=http://learnr.wordpress.com/2009/08/26/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-final-part/|title=ggplot2 Version of Figures in "Lattice: Multivariate Data Visualization with R" (Final Part)}}</ref>
Creating a different plot for various subsets of the data requires for loops and manual management in base R graphics, whereas ggplot2 simplifies that process with a collection of "facet" functions to choose from.
One potential limitation of base R graphics is the "pen-and-paper model" utilized to populate the plotting device.<ref>{{cite book|last=Wickham|first=Hadley|title=ggplot2: Elegant Graphics for Data Analysis |year=2009 |publisher=Springer |isbn=978-0-387-98140-6|pages=5}}</ref> Graphical output from the interpreter is added directly to the plotting device or window rather than separately for each distinct element of a plot.<ref>{{cite journal |last=Murrell |first=Paul |title=R Graphics|journal=Wiley Interdisciplinary Reviews: Computational Statistics|date=August 2009|volume=1|issue=2|pages=216–220|doi=10.1002/wics.22}}</ref> In this respect it is similar to the lattice package, though Wickham argues ggplot2 inherits a more formal model of graphics from Wilkinson.<ref>{{cite book|last=Sarkar|first=Deepayan|title=Lattice: multivariate data visualization with R|year=2008|publisher=Springer|isbn=978-0-387-75968-5|pages=xi}}</ref> As such, it allows for a high degree of modularity; the same underlying data can be transformed by many different scales or layers.<ref>{{cite book|last=Teetor|first=Paul|title=R Cookbook|year=2011|publisher=O'Reilly|isbn=978-0-596-80915-7|pages=223}}</ref><ref>{{cite journal|last=Wickham|first=Hadley|date=March 2010|title=A Layered Grammar of Graphics|url=http://vita.had.co.nz/papers/layered-grammar.pdf|journal=Journal of Computational and Graphical Statistics|volume=19|issue=1|pages=3–28|doi=10.1198/jcgs.2009.07098|s2cid=58971746}}</ref>
|