4 Summaries

Before you begin this section, make sure you have fully understood the section on datasets and dataframes, and in particular that you are happy using the %>% symbol to describe a flow of data.

Although R contains many functions like table, or xtabs, describe or summarise which you might see used elsewhere to tabulate or summarise data, for beginners these base-R functions can be confusing; their names and input names are not always consistent, and they don’t always work together nicely.

Instead we recommend using dplyr and other parts of the tidyverse because they provide a general set of tools to make any kind of table or summary.

They also encourage more coherent thinking about what summary is really needed, rather than accepting or fighting with default options.