{"id":13477448,"url":"https://github.com/r-lib/devtools","last_synced_at":"2025-12-17T21:17:47.101Z","repository":{"id":694861,"uuid":"643909","full_name":"r-lib/devtools","owner":"r-lib","description":"Tools to make an R developer's life easier","archived":false,"fork":false,"pushed_at":"2025-04-04T08:49:40.000Z","size":13716,"stargazers_count":2449,"open_issues_count":45,"forks_count":762,"subscribers_count":118,"default_branch":"main","last_synced_at":"2025-05-06T17:13:42.770Z","etag":null,"topics":["package-creation","r"],"latest_commit_sha":null,"homepage":"https://devtools.r-lib.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2010-05-03T04:08:49.000Z","updated_at":"2025-04-27T23:31:48.000Z","dependencies_parsed_at":"2023-07-05T15:17:19.146Z","dependency_job_id":"beed08f4-f640-4859-a7c7-db31140273d5","html_url":"https://github.com/r-lib/devtools","commit_stats":{"total_commits":3076,"total_committers":169,"mean_commits":"18.201183431952664","dds":0.6222366710013003,"last_synced_commit":"c3fa3dfb8de4e37b573cccff76f8c35a65a4488b"},"previous_names":["hadley/devtools"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fdevtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fdevtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fdevtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fdevtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/devtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000824,"owners_count":21997441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["package-creation","r"],"created_at":"2024-07-31T16:01:42.958Z","updated_at":"2025-12-17T21:17:42.058Z","avatar_url":"https://github.com/r-lib.png","language":"R","readme":"# devtools \u003ca href=\"https://devtools.r-lib.org/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" alt=\"\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/r-lib/devtools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/devtools/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/devtools/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/devtools?branch=main)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/devtools)](https://cran.r-project.org/package=devtools)\n\u003c!-- badges: end --\u003e\n\nThe aim of devtools is to make package development easier by providing R\nfunctions that simplify and expedite common tasks. [R\nPackages](https://r-pkgs.org/) is a book based around this workflow.\n\n## Installation\n\n```r\n# Install devtools from CRAN\ninstall.packages(\"devtools\")\n\n# Or the development version from GitHub:\n# install.packages(\"pak\")\npak::pak(\"r-lib/devtools\")\n```\n\n## Cheatsheet\n\n\u003ca href=\"https://raw.githubusercontent.com/rstudio/cheatsheets/main/package-development.pdf\"\u003e\u003cimg src=\"https://github.com/rstudio/cheatsheets/raw/main/pngs/thumbnails/package-development-thumbs.png\" height=\"252\" alt=\"thumbnail of package development cheatsheet\"/\u003e\u003c/a\u003e\n\n\n## Usage\n\nAll devtools functions accept a path as an argument, e.g.\n`load_all(\"path/to/mypkg\")`. If you don't specify a path, devtools will\nlook in the current working directory - this is a recommended practice.\n\n### Frequent development tasks:\n\n* `load_all()` simulates installing and reloading your package, loading R code\n  in `R/`, compiled shared objects in `src/` and data files in `data/`. During\n  development you would usually want to access all functions (even un-exported\n  internal ones) so `load_all()` works as if all functions were exported in the\n  package `NAMESPACE`.\n\n* `document()` updates generated documentation in `man/`, file collation and\n  `NAMESPACE`.\n\n* `test()` reloads your code with `load_all()`, then runs all `testthat` tests.\n\n* `test_coverage()` runs test coverage on your package with\n  [covr](https://github.com/r-lib/covr). This makes it easy to see what parts of your\n  package could use more tests!\n\n### Building and installing:\n\n* `install()` reinstalls the package, detaches the currently loaded version\n  then reloads the new version with `library()`. Reloading a package is not\n  guaranteed to work: see the documentation for `unload()` for caveats.\n\n* `build()` builds a package file from package sources. You can use it to build\n  a binary version of your package.\n\n* `install_*` functions install an R package:\n   * `install_github()` from GitHub\n   * `install_gitlab()` from GitLab\n   * `install_bitbucket()` from Bitbucket\n   * `install_url()` from an arbitrary url\n   * `install_git()` and `install_svn()` from an arbitrary git or SVN repository\n   * `install_local()` from a local file on disk\n   * `install_version()` from a specific version on CRAN\n\n* `update_packages()` updates a package to the latest version. This works\n  both on packages installed from CRAN as well as those installed from any of\n  the `install_*` functions.\n\n### Check and release:\n\n* `check()` updates the documentation, then builds and checks the package locally.\n  `check_win()` checks a package using\n  [win-builder](https://win-builder.r-project.org/), and `check_rhub()` checks a package using\n  [r-hub](https://log.r-hub.io/). This allows you to easily check\n  your package on all systems CRAN uses before submission.\n\n* `release()` makes sure everything is ok with your package (including asking\n  you a number of questions), then builds and uploads to CRAN.\n\n## Learning more\n\nR package development can be intimidating, however there are now a number of\nvaluable resources to help!\n\n\u003ca href=\"https://r-pkgs.org\"\u003e\u003cimg src=\"http://r-pkgs.org/images/cover-2e-small.png\" height=\"252\" align = \"right\" alt=\"Cover image of R Packages book\"/\u003e\u003c/a\u003e\n\n1. R Packages is a book that gives a comprehensive treatment of all common parts\n   of package development and uses devtools throughout.\n    * The first edition is no longer available online, but it is still in print. Note that it has grown somewhat out of sync with the current version of devtools.\n    * A second edition that reflects the current state of devtools, plus new topics such as package websites and GitHub Actions, is available at \u003chttps://r-pkgs.org\u003e and in paperback format.\n    * The [Whole Game](https://r-pkgs.org/whole-game.html) and\n      [Package structure](https://r-pkgs.org/package-structure-state.html) chapters\n      make great places to start.\n\n2. [Posit Community - package\n   development](https://forum.posit.co/c/package-development/11)\n   is a great place to ask specific questions related to package development.\n\n3. [rOpenSci packages](https://devguide.ropensci.org/) has\n   extensive documentation on best practices for R packages looking to be\n   contributed to rOpenSci, but also very useful general recommendations\n   for package authors.\n\n4. There are a number of fantastic blog posts on writing your first package, including\n   - [Writing an R package from scratch - Hilary Parker](https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/)\n   - [How to develop good R packages - Maëlle Salmon](https://masalmon.eu/2017/12/11/goodrpackages/)\n   - [Making your first R package - Fong Chun Chan](https://tinyheero.github.io/jekyll/update/2015/07/26/making-your-first-R-package.html)\n   - [Writing an R package from scratch - Tomas Westlake](https://r-mageddon.netlify.app/post/writing-an-r-package-from-scratch/)\n\n5. [Writing R\n   Extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html) is\n   the exhaustive, canonical reference for writing R packages, maintained by\n   the R core developers.\n\n## Conscious uncoupling\n\ndevtools started off as a lean-and-mean package to facilitate local package\ndevelopment, but over the years it accumulated more and more functionality.\ndevtools has undergone a [conscious\nuncoupling](https://web.archive.org/web/20140326060230/https://www.goop.com/journal/be/conscious-uncoupling)\nto split out functionality into smaller, more tightly focussed packages. This\nincludes:\n\n* [testthat](https://github.com/r-lib/testthat): Writing and running tests\n  (i.e. `test()`).\n\n* [roxygen2](https://github.com/r-lib/roxygen2): Function and package documentation\n  (i.e. `document()`).\n\n* [remotes](https://github.com/r-lib/remotes): Installing packages (i.e.\n  `install_github()`).\n\n* [pkgbuild](https://github.com/r-lib/pkgbuild): Building binary packages\n  (including checking if build tools are available) (i.e. `build()`).\n\n* [pkgload](https://github.com/r-lib/pkgload): Simulating package loading (i.e.\n  `load_all()`).\n\n* [rcmdcheck](https://github.com/r-lib/rcmdcheck): Running R CMD check and\n  reporting the results (i.e. `check()`).\n\n* [revdepcheck](https://github.com/r-lib/revdepcheck): Running R CMD check on\n  all reverse dependencies, and figuring out what's changed since the last CRAN\n  release (i.e. `revdep_check()`).\n\n* [sessioninfo](https://github.com/r-lib/sessioninfo): R session info (i.e.\n  `session_info()`).\n\n* [usethis](https://github.com/r-lib/usethis): Automating package setup (i.e.\n  `use_test()`).\n\nGenerally, you would not need to worry about these different packages, because\ndevtools installs all of them automatically. You will need to care, however, if\nyou're filing a bug because reporting it at the correct place will lead to a\nspeedier resolution.\n\nYou may also need to care if you are trying to use some devtools functionality\nin your own package or deployed application. Generally in these cases it\nis better to depend on the particular package directly rather than depend on devtools,\ne.g. use `sessioninfo::session_info()` rather than `devtools::session_info()`,\nor `remotes::install_github()` vs `devtools::install_github()`.\n\nHowever for day to day development we recommend you continue to use\n`library(devtools)` to quickly load all needed development tools, just like\n`library(tidyverse)` quickly loads all the tools necessary for data exploration\nand visualization.\n\n## Code of conduct\n\nPlease note that the devtools project is released with a [Contributor Code of Conduct](https://github.com/r-lib/devtools/blob/main/.github/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.\n","funding_links":[],"categories":["R","Table of Contents"],"sub_categories":["Development in R"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fdevtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fdevtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fdevtools/lists"}