Book description
Turn your R code into packages that others can easily download and use. This practical book shows you how to bundle reusable R functions, sample data, and documentation together by applying author Hadley Wickham’s package development philosophy. In the process, you’ll work with devtools, roxygen, and testthat, a set of R packages that automate common development tasks. Devtools encapsulates best practices that Hadley has learned from years of working with this programming language.
Ideal for developers, data scientists, and programmers with various backgrounds, this book starts you with the basics and shows you how to improve your package writing over time. You’ll learn to focus on what you want your package to do, rather than think about package structure.
- Learn about the most useful components of an R package, including vignettes and unit tests
- Automate anything you can, taking advantage of the years of development experience embodied in devtools
- Get tips on good style, such as organizing functions into files
- Streamline your development process with devtools
- Learn the best way to submit your package to the Comprehensive R Archive Network (CRAN)
- Learn from a well-respected member of the R community who created 30 R packages, including ggplot2, dplyr, and tidyr
Publisher resources
Table of contents
- Preface
- I. Getting Started
- 1. Introduction
- 2. Package Structure
- II. Package Components
- 3. R Code
- 4. Package Metadata
- 5. Object Documentation
- 6. Vignettes: Long-Form Documentation
- 7. Testing
- 8. Namespace
- 9. External Data
- 10. Compiled Code
- 11. Installed Files
- 12. Other Components
- III. Best Practices
-
13. Git and GitHub
- RStudio, Git, and GitHub
- Initial Setup
- Creating a Local Git Repository
- Seeing What’s Changed
- Recording Changes
- Best Practices for Commits
- Ignoring Files
- Undoing Mistakes
- Synchronizing with GitHub
- Benefits of Using GitHub
- Working with Others
- Issues
- Branches
- Making a Pull Request
- Submitting a Pull Request to Another Repo
- Reviewing and Accepting Pull Requests
- Learning More
- 14. Automated Checking
- 15. Releasing a Package
- Index
Product information
- Title: R Packages
- Author(s):
- Release date: March 2015
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781491910542
You might also like
book
R Packages, 2nd Edition
Turn your R code into packages that others can easily install and use. With this fully …
book
Dynamic Documents with R and knitr, 2nd Edition
Suitable for both beginners and advanced users, this popular book makes writing statistical reports easier by …
book
Advanced R
An Essential Reference for Intermediate and Advanced R Programmers Advanced R presents useful tools and techniques …
book
Writing code for R packages
R packages are a great way to share and create code that you and others can …