Skip to Content
R for Data Science
book

R for Data Science

by Hadley Wickham, Garrett Grolemund
December 2016
Beginner to intermediate
520 pages
10h 12m
English
O'Reilly Media, Inc.
Content preview from R for Data Science

Chapter 21. R Markdown

Introduction

R Markdown provides a unified authoring framework for data science, combining your code, its results, and your prose commentary. R Markdown documents are fully reproducible and support dozens of output formats, like PDFs, Word files, slideshows, and more.

R Markdown files are designed to be used in three ways:

  • For communicating to decision makers, who want to focus on the conclusions, not the code behind the analysis.

  • For collaborating with other data scientists (including future you!), who are interested in both your conclusions, and how you reached them (i.e., the code).

  • As an environment in which to do data science, as a modern day lab notebook where you can capture not only what you did, but also what you were thinking.

R Markdown integrates a number of R packages and external tools. This means that help is, by and large, not available through ?. Instead, as you work through this chapter, and use R Markdown in the future, keep these resources close to hand:

  • R Markdown Cheat Sheet: available in the RStudio IDE under Help → Cheatsheets → R Markdown Cheat Sheet

  • R Markdown Reference Guide: available in the RStudio IDE under Help → Cheatsheets → R Markdown Reference Guide

Both cheatsheets are also available at http://rstudio.com/cheatsheets.

Prerequisites

You need the rmarkdown package, but you don’t need to explicitly install it or load it, as RStudio automatically does both when needed.

R Markdown Basics

This is an R Markdown ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R for Data Science, 2nd Edition

R for Data Science, 2nd Edition

Hadley Wickham, Mine Çetinkaya-Rundel, Garrett Grolemund
Data Science for Business

Data Science for Business

Foster Provost, Tom Fawcett
Python and R for the Modern Data Scientist

Python and R for the Modern Data Scientist

Rick J. Scavetta, Boyan Angelov

Publisher Resources

ISBN: 9781491910382Errata PageSupplemental Content