Reproducible Research

with R & RStudio

Overview of the Book

Reproducible Research with R & RStudio gives you tools for data gathering, analysis, and presentation of results so that you can create dynamic and highly reproducible research.

Tools you will learn as part of a reproducible research workflow:

R: a programming language primarily for statistics and graphics. We will focus on using it for dynamic data gathering and presenting results.

knitr: an R package for literate programming, i.e. it allows you to combine your statistical analysis and the presentation of the results into one document. It works with R and a number of other
languages such as Bash, Python, and Ruby.

Markup languages: instructions for how to format a presentation document. Specifically we cover LaTeX for creating PDF articles and slide shows, as well as Markdown,
and a little HTML for presenting results on the web.

Unix-like shell programs: These tools are useful for working with large research projects. They also allow us to use command line tools including GNU Make for compiling
projects and Pandoc, a program useful for converting documents from one markup language to another.

Cloud storage & versioning: Services such as Dropbox and Git/Github that can store data, code, and presentation
files, save previous versions of these files, and make this information widely available.

RStudio: an integrated developer environment (IDE) for R that tightly integrates these reproducible research tools in one place.

Who Should Read the Book?

Academic Researchers: This book is intended to be a practical guide for how to actually make your research reproducible. Even if you already use tools such as R and LaTeX you may not be leveraging their full potential.
This book will teach you useful ways to get the most out of them as part of a reproducible research workflow.

Students: Upper-level undergraduate and graduate students conducting original computational research should make your research reproducible. Forcing yourself to clearly document the steps you took will also encourage
you to think more clearly about what you are doing and reinforce what you are learning. It will hopefully give you a greater appreciation of research accountability and integrity early in your career.

Instructors: When instructors incorporate the tools of reproducible research into their assignments they not only build students’ understanding of research best practice, but are also better able to evaluate and provide
meaningful feedback on students’ work. This book provides a resource that you can use with students to put reproducibility into practice.

Editors: Beyond a lack of reproducible research skills among researchers, an impediment to actually creating reproducible research is a lack of infrastructure to publish it. Hopefully, this book will be useful for
editors at academic publishers who want to be better at evaluating reproducible research, editing it, and developing systems to make it more widely available.

Private Sector Researchers: Researchers in the private sector may or may not want to make their work easily reproducible outside of their organization. However, that does not mean that significant benefits cannot be
gained from using the methods of reproducible research. Making your research reproducible to members of your organization can spread valuable information about how analyses were done and data was collected. This will help build
your organization’s knowledge and avoid effort duplication.

Extra Materials

In addition, feel free to install the repmis package for R. The package includes tools for loading and citing other R packages (including old versions) and sourcing data sets
from secure (https) URLs, including from Dropbox and GitHub. These functions are coverd in more detail in the book. You can install repmis directly
from CRAN with the following code:

If you notice software changes that should be noted on the Updates page or have any suggestions for future editions of the book, including new reproducible research technologies to cover, feel free to leave
a comment on the Book's development page.

Corrections to typos in the current printed version be found on the Errata page.