Build Status AppVeyor Build Status Coverage Status CRAN_Status_Badge

The aim of devtools is to make package development easier by providing R functions that simplify and expedite common tasks. R Packages is a book based around this workflow.


# Install devtools from CRAN

# Or the development version from GitHub:
# install.packages("devtools")



All devtools functions accept a path as an argument, e.g. load_all("path/to/mypkg"). If you don’t specify a path, devtools will look in the current working directory - this is recommended practice.

Frequent development tasks:

Building and installing:

Check and release:

Learning more

R package development can be intimidating, however there are now a number of valuable resources to help!

  1. R Packages gives a comprehensive treatment of all common parts of package development and uses devtools throughout. The Package structure chapter is a great place to get started understanding the parts of a package and how they work together.

  2. RStudio community - package development is a great place to ask specific questions related to package development.

  3. rOpenSci packages has extensive documentation on best practices for R packages looking to be contributed to rOpenSci, but also very useful general recommendations for package authors.

  4. There are a number of fantastic blog posts on writing your first package, including
  5. Writing R Extensions is the exhaustive, canonical reference for writing R packages, maintained by the R core developers.

Conscious uncoupling

devtools started off as a lean-and-mean package to facilitate local package development, but over the years it accumulated more and more functionality. Currently devtools is undergoing a conscious uncoupling to split out functionality into smaller, more tightly focussed packages. This includes:

Generally, you should not need to worry about these different packages, because devtools installs them all automatically. You will need to care, however, if you’re filing a bug because reporting it at the correct place will lead to a speedier resolution.

Code of conduct

Please note that the devtools project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.