A major challenge in data analysis is to summarize and present data with informative graphs. The ggplot2 package was specifically designed to help with this task. Since it is a very powerful and well documented package, this introduction will only focus on its basic syntax, so that the user gets a better understanding of how to read the supporting material on the internet.
ggplot graphs are built with some kind of blocks, which usually start with the function ggplot. Its first argument contains the data object and the second argument is a further function called aes. It controls, which columns of the data frame are used for the axes, colours, shapes of the data points and further features of the graph. The remaining blocks are separated by plus + signs and – if not specified otherwise – take the information from the first block and add a certain aspect to the graph, for example additional lines or data points. To understand what this all means, let us look at some basic examples.