DCL books

The following are some (in-progress, evolving) blogdown books that we use in the DCL. Issues and pull requests are more than welcome.

See the DCL open content page for a more visual portfolio.

Data visualization

A book on both ggplot2 and the creation of effective visualizations.

Before beginning this project, I expected to write a lot about the science of perception and the rules of data visualization. I thought your own mind and eyes were probably untrustworthy, and so any book on visualization would need to emphasize empirical research. Instead, I ended up thinking and writing about how to look carefully at your own plots and notice what works and what doesn’t.

2019 was the first year we used this book in the DCL, and it seemed to go pretty well. We ask students for notes on everything they read, and I’m still in the process of going through these notes and incorporating changes into the book.

Functional programming

An introduction to programming in R, including a series of chapters on purrr.

Geospatial visualization

This book currently only has one chapter, but others are in the works. The chapter covers how to create interactive maps with Mapbox Studio and integrate those maps into R Markdown documents.

Workflow tools

dcl package

Tools to teach the DCL, including an RStudio project template, R Markdown template, and specialized compare() function.

You can install the package in R with devtools::install_github("stanford-datalab/dcl").

Once you’ve installed the package, you can access our project template from the RStudio New Project wizard and our R Markdown template from the list of templates in the R Markdown wizard.

Project example and workflow

An example project highlighting our DCL project template. The workflow uses here::here(); separate folders for raw data, scripts, cleaned data, exploratory data analysis, and reports; and a makefile to keep everything up-to-date.

Code snippets tutorial

A brief tutorial on creating code snippets in RStudio.

Scoped verbs

Scoped verb basics

Scoped verbs with predicates

Scoped verbs cheat sheet

Two readings and a cheat sheet on dplyr’s incredibly useful scoped verbs.

Style guide

An expansion of the original tidyverse style guide.