devtools

Tools to make an R developer's life easier

https://github.com/r-lib/devtools

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    15 of 166 committers (9.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary

Keywords

package-creation r

Keywords from Contributors

rmarkdown pandoc travis-ci literate-programming tidyverse reproducibility codecov coverage coverage-report lesson
Last synced: 6 months ago · JSON representation

Repository

Tools to make an R developer's life easier

Basic Info
Statistics
  • Stars: 2,472
  • Watchers: 118
  • Forks: 761
  • Open Issues: 51
  • Releases: 35
Topics
package-creation r
Created almost 16 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

devtools

R-CMD-check Codecov test coverage CRAN_Status_Badge <!-- badges: end -->

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.

Installation

```r

Install devtools from CRAN

install.packages("devtools")

Or the development version from GitHub:

install.packages("pak")

pak::pak("r-lib/devtools") ```

Cheatsheet

thumbnail of package development cheatsheet

Usage

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 a recommended practice.

Frequent development tasks:

  • load_all() simulates installing and reloading your package, loading R code in R/, compiled shared objects in src/ and data files in data/. During development you would usually want to access all functions (even un-exported internal ones) so load_all() works as if all functions were exported in the package NAMESPACE.

  • document() updates generated documentation in man/, file collation and NAMESPACE.

  • test() reloads your code with load_all(), then runs all testthat tests.

  • test_coverage() runs test coverage on your package with covr. This makes it easy to see what parts of your package could use more tests!

Building and installing:

  • install() reinstalls the package, detaches the currently loaded version then reloads the new version with library(). Reloading a package is not guaranteed to work: see the documentation for unload() for caveats.

  • build() builds a package file from package sources. You can use it to build a binary version of your package.

  • install_* functions install an R package:

    • install_github() from GitHub
    • install_gitlab() from GitLab
    • install_bitbucket() from Bitbucket
    • install_url() from an arbitrary url
    • install_git() and install_svn() from an arbitrary git or SVN repository
    • install_local() from a local file on disk
    • install_version() from a specific version on CRAN
  • update_packages() updates a package to the latest version. This works both on packages installed from CRAN as well as those installed from any of the install_* functions.

Check and release:

  • check() updates the documentation, then builds and checks the package locally. check_win() checks a package using win-builder, and check_rhub() checks a package using r-hub. This allows you to easily check your package on all systems CRAN uses before submission.

  • release() makes sure everything is ok with your package (including asking you a number of questions), then builds and uploads to CRAN.

Learning more

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

Cover image of R Packages book

  1. R Packages is a book that gives a comprehensive treatment of all common parts of package development and uses devtools throughout.

    • 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.
    • A second edition that reflects the current state of devtools, plus new topics such as package websites and GitHub Actions, is available at https://r-pkgs.org and in paperback format.
    • The Whole Game and Package structure chapters make great places to start.
  2. Posit 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. devtools has undergone a conscious uncoupling to split out functionality into smaller, more tightly focussed packages. This includes:

  • testthat: Writing and running tests (i.e. test()).

  • roxygen2: Function and package documentation (i.e. document()).

  • remotes: Installing packages (i.e. install_github()).

  • pkgbuild: Building binary packages (including checking if build tools are available) (i.e. build()).

  • pkgload: Simulating package loading (i.e. load_all()).

  • rcmdcheck: Running R CMD check and reporting the results (i.e. check()).

  • revdepcheck: Running R CMD check on all reverse dependencies, and figuring out what's changed since the last CRAN release (i.e. revdep_check()).

  • sessioninfo: R session info (i.e. session_info()).

  • usethis: Automating package setup (i.e. use_test()).

Generally, you would not need to worry about these different packages, because devtools installs all of them 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.

You may also need to care if you are trying to use some devtools functionality in your own package or deployed application. Generally in these cases it is better to depend on the particular package directly rather than depend on devtools, e.g. use sessioninfo::session_info() rather than devtools::session_info(), or remotes::install_github() vs devtools::install_github().

However for day to day development we recommend you continue to use library(devtools) to quickly load all needed development tools, just like library(tidyverse) quickly loads all the tools necessary for data exploration and visualization.

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.

Owner

  • Name: R infrastructure
  • Login: r-lib
  • Kind: organization

GitHub Events

Total
  • Issues event: 28
  • Watch event: 86
  • Issue comment event: 38
  • Push event: 4
  • Pull request review event: 2
  • Pull request event: 8
  • Fork event: 18
Last Year
  • Issues event: 28
  • Watch event: 86
  • Issue comment event: 38
  • Push event: 4
  • Pull request review event: 2
  • Pull request event: 8
  • Fork event: 18

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 3,084
  • Total Committers: 166
  • Avg Commits per committer: 18.578
  • Development Distribution Score (DDS): 0.623
Past Year
  • Commits: 8
  • Committers: 6
  • Avg Commits per committer: 1.333
  • Development Distribution Score (DDS): 0.625
Top Committers
Name Email Commits
hadley h****m@g****m 1,162
Jim Hester j****r@g****m 799
Winston Chang w****n@s****g 365
Kirill Müller k****r@i****h 217
Jenny Bryan j****n@g****m 62
jennybc j****y@s****a 38
Robert M Flight r****9@g****m 34
Malcolm Barrett m****t@g****m 20
Kirill Müller k****r 17
Kevin Ushey k****y@g****m 16
Gabor Csardi c****r@g****m 16
lev-kuznetsov l****v@g****m 14
Geoff99 g****9@g****m 12
Jeroen Ooms j****s@g****m 12
Kohske Takahashi @ jurina t****e@g****m 12
Yoni Ben-Meshulam y****h@g****m 9
Facundo Muñoz f****z@o****r 8
Ben Bond-Lamberty b****y@p****v 8
Jaime Ashander j****r@u****u 8
RobertZK t****b@g****m 8
Lionel Henry l****y@g****m 8
Andy Teucher a****r@g****m 7
Yihui Xie x****e@y****e 6
hb hb@a****g 5
Craig Citro c****o@g****m 4
Konrad Rudolph k****h@g****m 4
Rich FitzJohn r****n@g****m 4
Jean-Olivier Irisson i****n@n****g 4
Imanuel Costigan i****n@m****m 4
Håkon Malmedal h****l@g****m 4
and 136 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 147
  • Total pull requests: 59
  • Average time to close issues: 3 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 113
  • Total pull request authors: 23
  • Average comments per issue: 2.68
  • Average comments per pull request: 1.58
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 24
  • Pull requests: 13
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 22
  • Pull request authors: 6
  • Average comments per issue: 0.92
  • Average comments per pull request: 0.54
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hadley (13)
  • jennybc (9)
  • stla (4)
  • olivroy (2)
  • billdenney (2)
  • MLopez-Ibanez (2)
  • telenskyt (2)
  • HenrikBengtsson (2)
  • pachadotdev (2)
  • MichaelChirico (2)
  • ateucher (2)
  • jhk0530 (2)
  • fweber144 (2)
  • ramiromagno (2)
  • DanChaltiel (2)
Pull Request Authors
  • hadley (14)
  • jennybc (9)
  • lionel- (8)
  • olivroy (6)
  • ateucher (3)
  • musvaage (3)
  • jgabry (2)
  • joesho112358 (2)
  • catalamarti (2)
  • m-muecke (2)
  • arcresu (2)
  • luisDVA (2)
  • IndrajeetPatil (2)
  • orgadish (2)
  • peterdesmet (2)
Top Labels
Issue Labels
feature (18) vignettes :scroll: (5) documentation (4) reprex (4) upkeep (4) release (2) bug (1) install (1)
Pull Request Labels

Packages

  • Total packages: 4
  • Total downloads:
    • cran 187,251 last-month
  • Total docker downloads: 47,692,253
  • Total dependent packages: 608
    (may contain duplicates)
  • Total dependent repositories: 3,209
    (may contain duplicates)
  • Total versions: 85
  • Total maintainers: 3
cran.r-project.org: devtools

Tools to Make Developing R Packages Easier

  • Versions: 49
  • Dependent Packages: 608
  • Dependent Repositories: 3,209
  • Downloads: 186,827 Last month
  • Docker Downloads: 47,670,640
Rankings
Downloads: 0.0%
Forks count: 0.1%
Stargazers count: 0.1%
Dependent repos count: 0.1%
Dependent packages count: 0.2%
Average: 3.0%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/r-lib/devtools
  • Versions: 32
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
cran.r-project.org: cylcop

Circular-Linear Copulas with Angular Symmetry for Movement Data

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 277 Last month
  • Docker Downloads: 21,613
Rankings
Stargazers count: 0.1%
Forks count: 0.1%
Average: 22.4%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 46.6%
Maintainers (1)
Last synced: 6 months ago
cran.r-project.org: RtsEva

Performs the Transformed-Stationary Extreme Values Analysis

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 147 Last month
Rankings
Forks count: 0.1%
Stargazers count: 0.1%
Dependent packages count: 28.7%
Average: 30.1%
Dependent repos count: 35.3%
Downloads: 86.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/lint.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.0.2 depends
  • usethis >= 2.1.6 depends
  • cli >= 3.3.0 imports
  • desc >= 1.4.1 imports
  • ellipsis >= 0.3.2 imports
  • fs >= 1.5.2 imports
  • lifecycle >= 1.0.1 imports
  • memoise >= 2.0.1 imports
  • miniUI >= 0.1.1.1 imports
  • pkgbuild >= 1.3.1 imports
  • pkgdown >= 2.0.6 imports
  • pkgload >= 1.3.0 imports
  • profvis >= 0.3.7 imports
  • rcmdcheck >= 1.4.0 imports
  • remotes >= 2.4.2 imports
  • rlang >= 1.0.4 imports
  • roxygen2 >= 7.2.1 imports
  • rversions >= 2.1.1 imports
  • sessioninfo >= 1.2.2 imports
  • stats * imports
  • testthat >= 3.1.5 imports
  • tools * imports
  • urlchecker >= 1.0.1 imports
  • utils * imports
  • withr >= 2.5.0 imports
  • BiocManager >= 1.30.18 suggests
  • DT >= 0.23 suggests
  • MASS * suggests
  • callr >= 3.7.1 suggests
  • covr >= 3.5.1 suggests
  • curl >= 4.3.2 suggests
  • digest >= 0.6.29 suggests
  • foghorn >= 1.4.2 suggests
  • gh >= 1.3.0 suggests
  • gmailr >= 1.0.1 suggests
  • httr >= 1.4.3 suggests
  • knitr >= 1.39 suggests
  • lintr >= 3.0.0 suggests
  • mockery >= 0.4.3 suggests
  • pingr >= 2.0.1 suggests
  • rhub >= 1.1.1 suggests
  • rmarkdown >= 2.14 suggests
  • rstudioapi >= 0.13 suggests
  • spelling >= 2.2 suggests
tests/testthat/testMarkdownVignettes/DESCRIPTION cran
  • knitr * suggests
  • rmarkdown * suggests
tests/testthat/testPkgdown/DESCRIPTION cran
  • knitr * suggests
  • pkgdown * suggests
tests/testthat/testTest/DESCRIPTION cran
  • testthat * suggests
tests/testthat/testTestWithDepends/DESCRIPTION cran
  • R * depends
  • testthat * suggests
tests/testthat/testTestWithFailure/DESCRIPTION cran
  • testthat * suggests