Skip to main content

Big data, the tidyverse way

“Big” is relative. For this book, data is big when it no longer fits comfortably in your computer’s memory, or when reading it takes long enough that you notice. A few gigabytes of detector events, a sky survey, or a few thousand snapshots of a simulation all qualify.

This part moves outward from memory to disk. 11  What data costs in memory measures what data costs in R’s memory and explains how R avoids copying it, following Advanced R. 12  R’s own formats: CSV and RDS covers the formats R reads and writes on its own: CSV, compressed CSV and R’s native RDS files. 13  Parquet: columns that compress introduces Parquet, the columnar file format that has become the standard for analytical data, and shows how the algorithms of Part II live inside it. 14  Arrow datasets: dplyr on data bigger than memory uses the arrow package to analyse a folder of Parquet files larger than memory with ordinary dplyr verbs, and 15  DuckDB: a database without the database does the same through DuckDB, a database that runs inside R.

The point of the whole part is that you never have to learn a second language. The filter(), mutate(), group_by() and summarise() you use on a small table in memory work on a hundred gigabytes of compressed files on disk. Only the engine underneath changes.