Skip to Content
R Packages
book

R Packages

by Hadley Wickham
March 2015
Intermediate to advanced
202 pages
4h 23m
English
O'Reilly Media, Inc.
Content preview from R Packages

Preface

In This Book

This book will guide you from being a user of R packages to being a creator of R packages. In Chapter 1, Introduction, you’ll learn why mastering this skill is so important, and why it’s easier than you think. Next, you’ll learn about the basic structure of a package, and the forms it can take, in Chapter 2, Package Structure. The subsequent chapters go into more detail about each component. They’re roughly organized in order of importance:

Chapter 3, R code
The most important directory is R/, where your R code lives. A package with just this directory is still a useful package. (And indeed, if you stop reading the book after this chapter, you’ll have still learned some useful new skills.)
Chapter 4, Package Metadata
The DESCRIPTION lets you describe what your package needs to work. If you’re sharing your package, you’ll also use the DESCRIPTION to describe what it does, who can use it (the license), and who to contact if things go wrong.
Chapter 5, Object Documentation
If you want other people (including “future you”!) to understand how to use the functions in your package, you’ll need to document them. I’ll show you how to use roxygen2 to document your functions. I recommend roxygen2 because it lets you write code and documentation together while continuing to produce R’s standard documentation format.
Chapter 6, Vignettes: Long-Form Documentation
Function documentation describes the nitpicky details of every function in your package. Vignettes give the ...
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 Packages, 2nd Edition

R Packages, 2nd Edition

Hadley Wickham, Jennifer Bryan
Nonparametric Hypothesis Testing: Rank and Permutation Methods with Applications in R

Nonparametric Hypothesis Testing: Rank and Permutation Methods with Applications in R

Stefano Bonnini, Livio Corain, Marco Marozzi, Luigi Salmaso

Publisher Resources

ISBN: 9781491910580Errata Page