Chapman and Hall/CRC
323 pages | 31 B/W Illus.
All the Tools for Gathering and Analyzing Data and Presenting Results
Reproducible Research with R and RStudio, Second Edition brings together the skills and tools needed for doing and presenting computational research. Using straightforward examples, the book takes you through an entire reproducible research workflow. This practical workflow enables you to gather and analyze data as well as dynamically present results in print and on the web.
New to the Second Edition
Create Dynamic and Highly Reproducible Research
This updated book provides all the tools to combine your research with the presentation of your findings. It saves you time searching for information so that you can spend more time actually addressing your research questions. Supplementary files used for the examples and a reproducible research project are available on the author’s website.
"The first edition of Reproducible Research with R and RStudio was an invaluable companion in the early stages of my journey, and I trust that the second edition will be equally useful to aspiring data analysts."
—MAA Reviews, July 2015
Praise for the First Edition:
"… a very practical book that teaches good practice in organizing reproducible data analysis and comes with a series of examples. … an extremely valuable overview of the current capabilities of R, RStudio, and related software tools for reproducible research. I recommend this book to anyone who wants to learn more about these fascinating tools."
—Biometrical Journal, 2014
"Gandrud has written a great outline of how a fully reproducible research project should look from start to finish, with brief explanations of each tool that he uses along the way. … the readers who will get the most use from this book are those already working in R and just need a way to organize their work. That being said, advanced undergraduate students in mathematics, statistics, and similar fields as well as students just beginning their graduate studies would benefit the most from reading this book. Many more experienced R users or second-year graduate students might find themselves thinking, ‘I wish I’d read this book at the start of my studies, when I was first learning R!’ … a good text for beginning graduate students or advanced undergraduate students who are just starting to do technical research. … This book could be used as the main text for a class on reproducible research …"
—The American Statistician, November 2014
"Three recent books have significantly influenced how I use R in reproducible work: Dynamic Documents with R and knitr by Yihui Xie, Reproducible Research with R and RStudio by Christopher Gandrud, and Implementing Reproducible Research edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng … I recommend all three books to R users at any level. There really is something here for everyone."
—Richard Layton, PhD, PE, Rose-Hulman Institute of Technology, Terre Haute, Indiana, USA
Introducing Reproducible Research
What Is Reproducible Research?
Why Should Research Be Reproducible?
Who Should Read This Book?
The Tools of Reproducible Research
Why Use R, knitr/rmarkdown, and RStudio for Reproducible Research?
Getting Started with Reproducible Research
The Big Picture: A Workflow for Reproducible Research
Practical Tips for Reproducible Research
Getting Started with R, RStudio, and knitr/rmarkdown
Using R: the Basics
Using knitr and rmarkdown: the Basics
Getting Started with File Management
File Paths and Naming Conventions
Organizing Your Research Project
Setting Directories as RStudio Projects
R File Manipulation Commands
Unix-Like Shell Commands for File Management
File Navigation in RStudio
Data Gathering and Storage
Storing, Collaborating, Accessing Files, and Versioning
Saving Data in Reproducible Formats
Storing Your Files in the Cloud: Dropbox
Storing Your Files in the Cloud: GitHub
RStudio and GitHub
Gathering Data with R
Organize Your Data Gathering: Makefiles
Importing Locally Stored Data Sets
Importing Data Sets from the Internet
Advanced Automatic Data Gathering: Web Scraping
Preparing Data for Analysis
Cleaning Data for Merging
Merging Data Sets
Analysis and Results
Statistical Modelling and knitr
Incorporating Analyses into the Markup
Dynamically Including Modular Analysis Files
Reproducibly Random: set.seed
Computationally Intensive Analyses
Showing Results with Tables
Basic knitr Syntax for Tables
Creating Tables from Supported Class R Objects
Showing Results with Figures
Including Non-Knitted Graphics
Basic knitr/rmarkdown Figure Options
Knitting R’s Default Graphics
Including ggplot2 Graphics
Presenting with knitr/LaTeX
Bibliographies with BibTeX
Presentations with LaTeX Beamer
Large knitr/LaTeX Documents: Theses, Books, and Batch Reports
Planning Large Documents
Large Documents with Traditional LaTeX
knitr and Large Documents
Child Documents in a Different Markup Language
Creating Batch Reports
Presenting on the Web and Other Formats with R Markdown
Further Customizability with rmarkdown
Slideshows with Markdown, rmarkdown, and HTML
Publishing HTML Documents Created by R Markdown
Citing Reproducible Research
Licensing Your Reproducible Research
Sharing Your Code in Packages
Project Development: Public or Private?
Is it Possible to Completely Future Proof Your Research?