Front cover image for Ggplot2 : Elegant Graphics for Data Analysis

Ggplot2 : Elegant Graphics for Data Analysis

This book describes ggplot2, a new data visualization package for R that uses the insights from Leland Wilkison's ""Grammar of Graphics"" to create a powerful and flexible system for creating data graphics. With ggplot2, it's easy to: produce handsome, publication-quality plots, with automatic legends created from the plot specification superpose multiple layers (points, lines, maps, tiles, box plots to name a few) from different data sources, with automatically adjusted common scales add customisable smoothers that use the powerful modelling capabilities of R, such as loess, linear models, ge
eBook, English, 2009
Springer New York, New York, NY, 2009
Springer eBooks
1 online resource (210 pages)
9780387981406, 9780387981413, 9781282509917, 9786612509919, 0387981403, 0387981411, 1282509918, 6612509910
990531960
Contents
1 Introduction
1.1 Welcome to ggplot2
1.2 Other resources
1.3 What is the grammar of graphics?
1.4 How does ggplot2 fit in with other R graphics?
1.5 About this book
1.6 Installation
1.7 Acknowledgements
2 Getting started with qplot
2.1 Introduction
2.2 Datasets
2.3 Basic use
2.4 Colour, size, shape and other aesthetic attributes
2.5 Plot geoms
2.5.1 Adding a smoother to a plot
2.5.2 Boxplots and jittered points
2.5.3 Histogram and density plots
2.5.4 Bar charts 2.5.5 Time series with line and path plots2.6 Faceting
2.7 Other options
2.8 Differences from plot
3 Mastering the grammar
3.1 Introduction
3.2 Fuel economy data
3.3 Building a scatterplot
3.4 A more complex plot
3.5 Components of the layered grammar
3.5.1 Layers
3.5.2 Scales
3.5.3 Coordinate system
3.5.4 Faceting
3.6 Data structures
4 Build a plot layer by layer
4.1 Introduction
4.2 Creating a plot
4.3 Layers
4.4 Data
4.5 Aesthetic mappings
4.5.1 Plots and layers 4.5.2 Setting vs. mapping4.5.3 Grouping
4.5.4 Matching aesthetics to graphic objects
4.6 Geoms
4.7 Stat
4.8 Position adjustments
4.9 Pulling it all together
4.9.1 Combining geoms and stats
4.9.2 Displaying precomputed statistics
4.9.3 Varying aesthetics and data
5 Toolbox
5.1 Introduction
5.2 Overall layering strategy
5.3 Basic plot types
5.4 Displaying distributions
5.5 Dealing with overplotting
5.6 Surface plots
5.7 Drawing maps
5.8 Revealing uncertainty
5.9 Statistical summaries 5.9.1 Individual summary functions5.9.2 Single summary function
5.10 Annotating a plot
5.11 Weighted data
6 Scales, axes and legends
6.1 Introduction
6.2 How scales work
6.3 Usage
6.4 Scale details
6.4.1 Common arguments
6.4.2 Position scales
6.4.3 Colour
6.4.4 The manual discrete scale
6.4.5 The identity scale
6.5 Legends and axes
6.6 More resources
7 Positioning
7.1 Introduction
7.2 Faceting
7.2.1 Facet grid
7.2.2 Facet wrap
7.2.3 Controlling scales 7.2.4 Missing faceting variables7.2.5 Grouping vs. faceting
7.2.6 Dodging vs. faceting
7.2.7 Continuous variables
7.3 Coordinate systems
7.3.1 Transformation
7.3.2 Statistics
7.3.3 Cartesian coordinate systems
7.3.4 Non-Cartesian coordinate systems
8 Polishing your plots for publication
8.1 Themes
8.1.1 Built-in themes
8.1.2 Theme elements and element functions
8.2 Customising scales and geoms
8.2.1 Scales
8.2.2 Geoms and stats
8.3 Saving your output
8.4 Multiple plots on the same page
8.4.1 Subplots
""8.4.2 Rectangular grids""
English