Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
ggplot2: elegant graphics for data analysis (2nd ed.)
Wickham H., Springer International Publishing, New York, NY, 2016. 260 pp. Type: Book (978-3-319242-75-0)
Date Reviewed: May 30 2017

R is an open-source programming language that is popular for statistical computing and graphics. It provides a variety of statistical (linear and nonlinear modeling, statistical tests, time-series analysis, clustering, and so on) and graphical techniques, and can be extended rather easily via downloadable software packages. One of R’s strengths is the ease with which well-designed plots can be produced, including mathematical symbols and formulas.

Among the many graphical packages available for R, ggplot2 is different in that it claims to use a grammar to describe figures. The grammar is based on The grammar of graphics that was introduced by Wilkinson et al. in 2005 [1], and it describes the features that underlie all statistical graphics. ggplot2 is thus more like a language to describe graphics than graphics software. It allows one to build stepwise more and more complex graphics by adding layers of information. But ggplot2 is versatile enough to also allow quick creation of simple figures by using predefined drawing functions and attributes, as shown in chapter 2: By using a real-life dataset from the Internet, the author shows how to generate quickly different types of plots. This task-based introduction is continued in chapter 3. The real strength of ggplot2, however, comes with its layered approach that encourages the user to construct graphics in a structured manner. The purpose of chapter 4 is to describe “the theoretical basis of ggplot2: the layered grammar of graphics” (p. 77). Here, I would have expected some formal description of the grammar, for example, by using some metasyntax like the Backus-Naur form, in order to get a solid understanding of the grammar. However, the chapter continues to present different types of plots using the example dataset from the previous chapters. There is one schematic description of the plot generation process on page 84, but not of the grammar. A grammar would be a set of production rules for valid objects (for example, strings in a formal language). The book only says on page 85 that “the layered grammar defines a plot as the combination of: [a list of components follows].” So the author takes a rather pragmatic and less formal approach to describe the system. In the following four chapters, the components that form a plot are then described in more detail using practical examples.

Up to this point the book teaches the reader how to visualize nicely structured datasets. In real life, however, datasets are cluttered with additional information or formatted in ways that prohibit their direct use. The last part of the book presents different R packages that can help to prepare the data for later visualization. Chapter 9 shows how a package called tidyr can be used to tidy up datasets. Chapter 10 proposes the use of dplyr to aggregate data, and chapter 11 presents the broom package to convert models into datasets. R is a programming language and as such allows users to define functions to do repetitive tasks. The last chapter shows how functional programming techniques can be applied to ggplot2 objects.

The book is an excellent and very comprehensive manual of (according to the author) one of the most popular R packages. It is currently the only book describing ggplot2 in such depth. The book contains many examples and is very nicely illustrated, demonstrating the strength of the package. The second edition of the book was necessary to take into account several changes in the software since the first edition in 2009. Every serious user of ggplot2 will profit from this book.

More reviews about this item: Amazon, Goodreads

Reviewer:  Klaus Galensa Review #: CR145306 (1708-0508)
1) Wilkinson, L.; Wills, D.; Rope, D.; Norton, A.; Dubbs, R. The grammar of graphics. Springer, New York, NY, 2005.
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Mathematical Software (G.4 )
 
 
Statistical Computing (G.3 ... )
 
 
Programming Languages (D.3 )
 
 
Reference (A.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Mathematical Software": Date
Mathematical applications of electronic spreadsheets
Arganbright D., McGraw-Hill, Inc., New York, NY, 1984. Type: Book (9789780070024298)
May 1 1985
The NAG Library: a beginners guide
Phillips J., Oxford University Press, Inc., New York, NY, 1987. Type: Book (9789780198532637)
May 1 1988
Numerical software tools in C
Kempf J., Prentice-Hall, Inc., Upper Saddle River, NJ, 1987. Type: Book (9789780136272748)
Apr 1 1988
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy