# ModernDive is an open statistics textbook whose source is three branches wide

> ModernDive is the source of Statistical Inference via Data Science, an open textbook for learning statistical inference with R and the Tidyverse, now in its second edition and published in print by CRC Press. The repository carries a live bookdown build, an in-progress Quarto rewrite and the archived first edition, and the last push was on 2026-10-16.

**moderndive/ModernDive_book** — Statistical Inference via Data Science: A ModernDive into R and the Tidyverse

- Repository: https://github.com/moderndive/ModernDive_book
- Website: https://www.moderndive.com/v2/
- Stars: 809 · Forks: 545
- Language: HTML
- License: NOASSERTION
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/moderndive-moderndive-book

## An open textbook with a print edition

ModernDive is the repository for Statistical Inference via Data Science: A ModernDive into R and the Tidyverse, and the README treats it as the book's source rather than as a software project.

There are two editions and two live sites. The second edition, which is current, is at moderndive.com/v2/ and is also available in print from CRC Press. The first edition is archived at moderndive.com.

The repository carries the standard markers of an open textbook: a DOI badge pointing at Zenodo, so the book has a citable identifier, and a lifecycle badge marking it as stable, which is the R package lifecycle system's own status vocabulary. The release history records v1.1.0 in July 2020, described as cleaned bookdown code with typo fixes and a new Tips and Tricks page, then v2.0.0 in March 2025, the second edition of the CRC book, and v2.9.0 in August 2026, the Quarto edition that is live at moderndive.com/v2.

The topic list gives a sense of the syllabus, and it is a modern one: dplyr, ggplot2, infer, regression and regression models, hypothesis testing, the bootstrap method, the permutation test, confidence intervals, data wrangling, data visualisation and the tidyverse, all with an rstats and rstudio angle.

The default branch is v2, and the primary language of the repository is recorded as HTML, which is a hint about where the effort goes: this is a book that renders to a website and to print, and the HTML output is the more important artefact.

## Three branches, three sources, two live sites

The branch table in the README is the clearest description of the project state, and it is worth reading carefully before you clone anything.

The v2-quarto-html branch holds the Quarto sources as .qmd files, is under active development for the next release of the second edition, and deploys to the v2-publish branch as a preview.

The v2 branch holds the bookdown sources as .Rmd files, is the canonical build of the second edition currently served at moderndive.com/v2, and will be superseded by v2-quarto-html after a merge. It deploys to gh-pages/v2/.

The master branch holds the first edition bookdown sources and deploys to gh-pages, which is the live moderndive.com site.

So the situation for a visitor is slightly confusing and entirely deliberate. The site you land on is served from the bookdown build, the bookdown build is the canonical source today, and the Quarto rewrite that will eventually replace it lives on a different branch. The v2-publish branch exists so that the rewrite can be previewed without touching the live site.

For previously released versions, the README points at the Releases page for the source, and NEWS.md holds a summary of all the changes between versions. There is also a previous_versions/ directory in the tree for earlier editions.

The chapter file names at the root show the structure of the book itself, running from 00-foreword and 00-preface through 01-getting-started, 02-visualization, 03-wrangling, 04-tidy, 05-regression, 06-multiple-regression, 07-sampling, 08-confidence-intervals, 09-hypothesis-testing and 10-inference-for-regression to 11-tell-your-story-with-data, followed by five appendices, a glossary and the references.

## The move from bookdown to Quarto is the current work

The migration is the live story of the repository. The README says the book has been migrated from bookdown to Quarto, and that as of v2.1.0 the live build pipeline uses Quarto.

That sentence sits next to a table saying the v2 branch is still the canonical build, which is the tension a reader has to resolve: the pipeline behind the site is Quarto, while the sources that produce the site are still bookdown files, and the Quarto sources of the next release are on their own branch.

For a contributor, the practical effect is that there are two toolchains in the repository and you need to know which one your change belongs to. The tree shows the evidence. There is a .quarto/ directory and a _quarto.yml file for the Quarto side, and the _extensions/ and _includes/ directories, plus a krantz.cls file, a style.css, a bib/ directory and a latex/ directory, which are the bookdown and LaTeX machinery.

The chapter filenames are also telling. The current root listing uses .qmd files, from 00-foreword.qmd through 99-references.qmd, which means the working tree on the default branch is the Quarto version, even though the v2 branch is documented as bookdown. The two coexist during the transition, and the README's table is the authority on which is which.

Everything else about the repository follows a standard R book project. There is a DESCRIPTION file, an .Rprofile, a renv.lock and an renv/ directory for the locked R package environment, an .Rproj file for RStudio, a scripts/ directory, a data/ directory, and a .cspell.json with a wordlist for the spell checker.

## Building the book on your own machine

The README gives a four step procedure for rendering the second edition locally from the v2-quarto-html branch, and it is short enough to follow exactly.

Install Quarto, at version 1.4 or newer, and install R, noting that the build was developed against R 4.5.2. Then, from the repository root, restore the locked R package environment, and finally run quarto preview for live reload or quarto render for a one-shot HTML build into docs/.

```bash
renv::restore()
quarto preview
```

```bash
quarto render
```

The first edition is still on bookdown, and the README gives the older recipe for it, which requires the bookdown package and a call to render the index.Rmd file.

```bash
bookdown::render_book("index.Rmd")
```

The use of renv is the part that makes this reproducible. The lock file pins the R package versions the book was built against, so the code in the chapters runs against the versions the authors tested, and a chapter whose output has to match a figure will match. That matters more here than in a typical code project, because the book is full of printed outputs of data analysis steps, and a package upgrade that changes a default plot theme changes the page.

The repository also carries a GitHub Actions workflow for Quarto publishing, so the same pipeline that builds the book for the website can be run locally.

## The R package, the exercises and the instructor resources

The book is not self-contained, and the README points at the pieces that support it.

The moderndive R package provides datasets, helpers and the get_regression_*() functions used throughout the book. That is the part a reader interacts with from an R session, and it is a separate project with its own documentation at moderndive.github.io/moderndive/.

The repository itself carries the teaching apparatus. There is an exercises/ directory, an lc-answers/ directory, which by its name holds the solutions for the learning checks, an extras/ directory for supplementary notes, and a scripts/ directory for the code that generates the book's figures and output. The rds/ directory holds cached data objects so the book can render without re-running every computation.

For instructors there is a separate resources page at moderndive.com/labs with sample problem sets and term projects, which is the part you need if you are teaching a course rather than reading the book.

There is also a mailing list for periodic ModernDive updates, which the README says arrive roughly every three months. That is a useful signal about the pace of the project: a book that is revised on a term-like schedule, with tagged releases for the published versions and a NEWS.md that records what changed between them.

## The licence question for an open textbook

The repository carries a LICENSE.md file, and GitHub's own classification of the repository licence is recorded as a custom one that it cannot categorise, so the file in the tree is the text to read rather than a badge to trust.

For an open textbook the licensing picture is not a single answer, because there are several different things in the repository. The prose of the chapters, the exercises, the solutions, the R package that lives in a separate repository, the data files, the images including the cover and the logos, and the LaTeX class file all sit under different heads. A book that is published in print by a publisher, and which carries a DOI and a Zenodo record, is usually published under a Creative Commons style licence for the text with the code and data under a separate software licence, but the specific terms are what the LICENSE.md file records.

The practical advice is to read that file, and to check it separately for the things you plan to reuse. Course slides that reproduce a figure, an exercise set that you hand to your students, a dataset you use in a different project, and the cover image in your own presentation are four different questions, and the answers are not always the same.

What is not in doubt is that the source is open. The book is written as .qmd and .Rmd sources in a public repository with a build pipeline anyone can run, and the print edition exists alongside it.

## Conclusion

ModernDive fits a student or instructor who wants a statistics course taught through data analysis in R rather than through derivations, and a course designer who wants the exercises, solutions and the supporting R package under an open licence. It is the wrong choice for a project that needs a maintained software library, because the moderndive package is a companion to the book rather than the product, and it is the wrong choice if you want the print edition's typesetting without a Quarto toolchain. Before using it in a course, check which branch the version you want comes from, because the live site is still the bookdown build while the Quarto rewrite is in preview, and read the LICENSE.md file in the repository for the terms that apply to the text, the exercises and the data separately.

## FAQ

### What is ModernDive and who is it for?

It is the source repository for Statistical Inference via Data Science: A ModernDive into R and the Tidyverse, an open textbook that teaches statistical inference through data analysis in R. The second edition is live at moderndive.com/v2/ and is also published in print by CRC Press.

### Which branch should I use to build the ModernDive book?

For the second edition as currently served, the v2 branch holds the canonical bookdown sources, while v2-quarto-html holds the Quarto sources under active development and deploys to a preview branch. The master branch holds the archived first edition, and the README says v2 will be superseded by v2-quarto-html after a merge.

### How do I render the ModernDive book locally?

Install Quarto 1.4 or newer and R, the build having been developed against R 4.5.2, then run renv::restore() from the repository root to restore the locked package environment, and finally quarto preview for live reload or quarto render for a one-shot HTML build into docs/.

### What support files come with the ModernDive textbook?

The repository includes an exercises/ directory, an lc-answers/ directory for the learning check solutions, an extras/ directory, a scripts/ directory for the code behind the figures, an rds/ directory of cached data, a data/ directory, and a separate moderndive R package with the datasets, helpers and get_regression_*() functions used in the chapters. Instructor resources with problem sets and term projects are at moderndive.com/labs.

### When was the latest ModernDive release?

Version v2.9.0 on 2026-08-05, the Quarto edition that is live at moderndive.com/v2, after v2.0.0 in March 2025 for the second edition of the CRC book and v1.1.0 in July 2020. The last push to the repository was on 2026-10-16.

## Sources

- [Issues](https://github.com/moderndive/ModernDive_book/issues)
- [moderndive/ModernDive_book on GitHub](https://github.com/moderndive/ModernDive_book)
- [Project website](https://www.moderndive.com/v2/)
- [README](https://github.com/moderndive/ModernDive_book/blob/v2/README.md)
- [Releases](https://github.com/moderndive/ModernDive_book/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/moderndive-moderndive-book
