This new edition to the classic book by ggplot2 creator Hadley Wickham highlights compatibility with knitr and RStudio. ggplot2 is a data visualization package for R that helps users create data graphics, including those that are multi-layered, with ease. With ggplot2, it's easy to: produce handsome, publication-quality plots with automatic legends created from the plot specification superimpose multiple layers (points, lines, maps, tiles, box plots) from different data sources with automatically adjusted common scales add cust omizable smoothers that use powerful modeling capabilities of R, such as loess, linear models, generalized additive models, and robust regression save any ggplot2 plot (or part thereof) for later modification or reuse create custom themes that capture in-house or journal style requirements and that can easily be applied to multiple plots approach a graph from a visual perspective, thinking about how each component of the data is represented on the final plot This book will be useful to everyone who has struggled with displaying data in an informative and attractive way. Some basic knowledge of R is necessary (e.g., importing data into R). ggplot2 is a mini-language specifically tailored for producing graphics, and you'll learn everything you need in the book. After reading this book you'll be able to produce graphics customized precisely for your problems, and you'll find it easy to get graphics out of your head and on to the screen or page. Table of Contents Part I Getting Started Chapter 1 Introduction Chapter 2 Getting Started with ggplot2 Chapter 3 Toolbox Part II The Grammar Chapter 4 Mastering the Grammar Chapter 5 Build a Plot Layer by Layer Chapter 6 Scales, Axes and Legends Chapter 7 Positioning Chapter 8 Themes Part III Data Analysis Chapter 9 Data Analysis Chapter 10 Data Transformation Chapter 11 Modelling for Visualisation Chapter 12 Programming with ggplot2 omizable smoothers that use powerful modeling capabilities of R, such as loess, linear models, generalized additive models, and robust regression save any ggplot2 plot (or part thereof) for later modification or reuse create custom themes that capture in-house or journal style requirements and that can easily be applied to multiple plots approach a graph from a visual perspective, thinking about how each component of the data is represented on the final plot This book will be useful to everyone who has struggled with displaying data in an informative and attractive way. Some basic knowledge of R is necessary (e.g., importing data into R). ggplot2 is a mini-language specifically tailored for producing graphics, and you'll learn everything you need in the book. After reading this book you'll be able to produce graphics customized precisely for your problems, and you'll find it easy to get graphics out of your head and on to the screen or page. Table of Contents Part I Getting Started Chapter 1 Introduction Chapter 2 Getting Started with ggplot2 Chapter 3 Toolbox Part II The Grammar Chapter 4 Mastering the Grammar Chapter 5 Build a Plot Layer by Layer Chapter 6 Scales, Axes and Legends Chapter 7 Positioning Chapter 8 Themes Part III Data Analysis Chapter 9 Data Analysis Chapter 10 Data Transformation Chapter 11 Modelling for Visualisation Chapter 12 Programming with ggplot2