5 ggplot2

5.1 Introduction

Styling suggestions for + used to separate ggplot2 layers are very similar to those for %>% in pipelines.

5.2 Whitespace

+ should always have a space before it, and should be followed by a new line. This is true even if your plot has only two layers. After the first step, each line should be indented by two spaces.

If you are creating a ggplot off of a dplyr pipeline, there should only be one level of indentation.