January 2, 2019

· R · Visualization

Chapter 2 of Data Visualization walks you through setting up an R Project, and takes advantage of R Studio’s support for RMarkdown templates. That is, once you’ve created your project in R Studio, can choose File > New File > R Markdown, like this:

R Studio menu

Select R Markdown …

And then choose “From Template” on the left side of the dialog box that pops up, and select the “Data Visualization Notes” option on the right:

R Studio menu

Pick a Template

Unfortunately, this option isn’t showing up for some users, due to a now-fixed error in the socviz library. If you run install_github("kjhealy/socviz") again from the console, you will get the newer version that fixes this issue.

There’s also an alternative and very quick way to get a project and notes files up and running. From the console, first make sure the socviz package is loaded:


Then, do this:


This will copy and unzip a folder to your Desktop containing an R project with a set of Rmarkdown files that are ready to be used to take notes with. You’ll get a message that looks something like this:

Copied dataviz_course_notes.zip to /Users/kjhealy/Desktop and expanded it into /Users/kjhealy/Desktop/dataviz_course_notes

Your user name will most likely be different, and the destination shown may be different also depending on what kind of computer you are using.

Once it has been created, you can navigate to that dataviz_course_notes folder and open it. Inside will be a dataviz folder that looks like this:

R Studio menu

Contents of the course packet.

Double-click on the dataviz.Rproj file and you should be good to go.

All Categories


I am Professor of Sociology at Duke University. I’m affiliated with the Kenan Institute for Ethics, the Markets and Management Studies program, and the Duke Network Analysis Center. Learn more.



To be notified of updates, you can subscribe to the  RSS feed for the site.