• Stars
    star
    153
  • Rank 235,065 (Top 5 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A curated list of awesome tools for R package development
title format toc keep-md date-modified author keywords
Awesome R Package Development Tools
gfm
true
true
2023-06-04
Indrajeet Patil
r packages
software development
software engineering
r

A curated list of awesome tools to assist ๐Ÿ“ฆ development in R programming language.

Awesome Track Awesome List

:::{.callout-tip}

What is included?

  • Only tools helpful for package development are included, and not other resources (e.g. books).
  • All relevant tools are included, irrespective of their availability on CRAN/Bioconductor.
  • Tools which are part of publicly archived/retired GitHub repositories are not included. :::

If you wish to suggest any additional tools, please make a PR or create an issue here.

Code of Conduct

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

Swiss army knives ๐Ÿ› 

Tools useful across all stages of package development (some of these are meta-packages and their component packages are also included in respective sections for the sake of completeness), irrespective of whether the package is meant to be submitted to CRAN or Bioconductor.

Package templates ๐Ÿ’€

Generic

RMarkdown-based

  • {fusen} (to build a package from RMarkdown files)

  • {litr} (to write a complete R package in a single R markdown document)

Shiny

  • {golem} (framework for building shiny applications)

  • {leprechaun} (leaner framework for building shiny applications)

  • {rhino} (a framework to build high quality, enterprise-grade Shiny apps at speed)

Meta-packages

Naming things ๐Ÿงธ

  • {available} (to check if a package name is available to use)

  • {collidr} (to check for namespace collisions)

  • {changer} (to change the name of an existing R package)

Working with package components

  • {rprojroot} (accessing files w.r.t. package root directory)

  • {desc} (manipulating DESCRIPTION files)

  • {withr} (to manage package side effects by safely and temporarily modifying global states)

  • {pkgload} (to simulate the process of installing and loading a package)

  • {pkgbuild} (to find tools needed to build packages)

Package configuration

  • {config} (to manage environment specific configuration values)

Package management tools

  • {pkgcache} (to cache 'CRAN'-like metadata and packages)

Documentation ๐Ÿ“š

Manual

  • {roxygen2} (to generate R package documentation from inline R comments)

  • {Rd2roxygen} (in case you inherit a project where documentation was not written using {roxygen2})

  • {sinew} (generate {roxygen2} skeletons)

  • {roclang} (helpers for diffusing content across function documentation)

  • {Rdpack} (for inserting references, figures, and evaluated examples in Rd docs)

  • {roxygen2md} (to allow Markdown syntax usage in {roxygen2} documentation)

  • {rd2markdown} (to convert .Rd package documentation files into markdown files)

  • {rd2list} (converts Rd docs to a human-readable list)

  • {pasteAsComment} (RStudio addin for pasting copied code as roxygen comment)

  • roxygen2Comment (Rstudio addin for adding and remove {roxygen2} comment)

Math rendering in HTML/PDF manual

  • {katex} (to convert latex math expressions to HTML for use in package manual pages)

  • {mathjaxr} (provides 'MathJax' and macros to enable its use within Rd files for rendering equations in the HTML help files)

  • {mathml} (translates R expressions to 'MathML' or 'MathJax' so that they can be rendered in HTML manual and Shiny apps)

Vignettes

  • {knitr} (a general-purpose tool for dynamic report generation to be used as a vignette builder for R package vignettes)

  • {rmarkdown} (to convert R Markdown documents to a variety of formats)

  • {RmdConcord} (to provide support for concordances in R Markdown files)

  • {quarto} (provides R interface to frequently used operations in the Quarto CLI)

  • {prettydoc} (creates lightweight yet pretty vignettes)

  • {learnr} (to turn any R Markdown document into an interactive tutorial)

Website

  • {pkgdown} (static website for package documentation)

  • {gitdown} (software changes as a gitbook)

  • {altdoc} (use docute, docsify, or MkDocs to create a static website for package documentation)

Translation

  • {potools} (for translating messages and checking the "health" of the messaging corpus)

Lifecycle

  • {lifecycle} (to manage the life cycle of exported functions)

Badges and stickers

  • {badger} (to query information and generate badges for use in README)

  • {hexSticker} (helper functions for creating reproducible hexagon sticker purely in R)

  • {hexFinder} (to scavenge the web for possible hex logos for packages)

  • hexwall (to create a wall of hexstickers)

Presentation

  • {xaringan} (an RMarkdown output format for remark.js slides)

Book

  • {bookdown} (authoring framework for books and technical documents with R Markdown)

Change log and versioning

  • {fledge} (to streamline the process of updating change logs and versioning R packages developed in git repositories)

  • {newsmd} (utilities to add updates to the NEWS.md file)

  • {autonewsmd} (to auto-generate change log using conventional commits)

Documentation quality โœ’๏ธ

Unit testing ๐Ÿงช

General

  • {testthat} (a testing framework for R that is easy to learn and use; also provides snapshot testing)

  • {patrick} (for parameterized unit testing with {testthat})

  • {tinytest} (zero-dependency unit testing framework that installs tests with the package)

  • {tinysnapshot} (snapshots for unit tests using the {tinytest} framework)

  • {RUnit} (a standard unit testing framework, with additional code inspection and report generation tools)

  • {testit} (a simple package for testing R packages)

  • {realtest} (a framework unit testing that distinguishes between expected, acceptable, current, fallback, ideal, or regressive behaviours)

  • {roxytest} (inline {testthat} tests with {roxygen2})

  • {roxut} (to write the unit tests in the same file as the function)

  • {exampletestr} (tests based on package examples)

  • {unitizer} (simplifies regression tests by comparing objects produced by test code with earlier versions of those same objects)

  • {r-hedgehog} (property based testing)

  • {autotest} (automatic mutation testing of R packages)

Markdown documents

  • {pandoc} (to check Markdown documents across various version of Pandoc)

Shiny applications

Web/database applications

  • {httptest} (a test environment for HTTP requests in R)

  • {httptest2} (the same for {httr2} package)

  • {webfakes} (provides fake web apps for HTTP testing R packages)

  • {dittodb} (makes testing against databases easy)

Visual regression testing

  • {vdiffr} (for visual regression testing with {testthat})

  • {gdiff} (for performing graphical difference different package or R versions)

Mock testing

  • {mockthat} (provides a way to mock package function for unit testing, while coping with S3 dispatch)

  • {mockr} (provides a way to mock package function for unit testing)

  • {mockery} (provides a way to mock package function for unit testing and can be used with any testing framework)

Helpers for testing frameworks

  • {testthis} (RStudio addins for working with files that contain tests)

  • {xpectr} (builds unit tests with the {testthat} package by providing tools for generating expectations)

  • {testdown} (turn {testthat} results into a {bookdown} project)

  • {ttdo} (provides 'diff'-style comparison of R objects for {tinytest} framework)

Code/Document Formatting ๐Ÿงฝ

  • {styler} (to format code according to a style guide)

  • {stylermd} (to format text in Markdown documents)

  • {formatR} (to format R source code)

  • {RFormatter} (extension of {formatR} with slightly improved heuristics)

  • {grkstyle} (extension package for {styler} that supports author's personal code style preferences)

  • {codegrip} (addin for RStudio IDE to reshape R code and navigate across syntactic constructs)

  • {BiocStyle} (provides standard formatting styles for Bioconductor PDF and HTML documents)

  • AlignAssign (RStudio addin that aligns the assignment operators within a highlighted area)

  • {snakecase} (helpful for having consistent case while naming objects in the package)

  • {dotInternals} (to distinguish non-exported package functions by prepending their names with a dot)

Code analysis ๐Ÿ—‚โฑ

General

  • {codetools} (code analysis tools for R)

  • {goodpractice} (Swiss army knife for good practices)

  • {inteRgrate} (provides an opinionated set of rules for R package development)

  • {pkgcheck} (checks if package follows good practices recommended for packages in the rOpenSci ecosystem)

  • {pkgstats} (a static code analysis tool)

  • {rchk} (provides several bug-finding tools that look for memory protection errors in C source code using R API)

  • {sourcetools} (tools for reading, tokenizing, and parsing R code)

  • {precommit} (git hooks for common tasks like formatting files, spell checking, etc.)

Code review

  • {PaRe} (reviews other packages during code review by looking at their dependencies, code style, code complexity, and how internally defined functions interact with one another)

Code coverage

  • {covr} (to compute code coverage)

  • {covrpage} (to include summary README of code coverage and more detailed information about tests)

  • {covtracer} (provides tools for contextualizing tests)

Lint detection

  • {lintr} (static code analysis)

  • {checkglobals} (to check R-packages for globals and imports)

  • {CodeDepends} (analysis of R code for reproducible research and code view)

  • {adaptalint} (infer code style from one package and use it to check another)

  • {roger} (provides tools for grading the coding style and documentation of R scripts)

  • {cleanr} (tests code for some of the most common code layout flaws)

Code complexity

Code similarity

  • {dupree} (identifies code blocks that have a high level of similarity within a set of R files)

  • {rscc} (provides source code similarity evaluation by variable/function names)

  • {SimilaR} (quantifies the similarity of the code-base of R functions by means of program dependence graphs)

Compiled code

JavaScript code

  • {jshintr} (to run JSHint for static code analysis for JavaScript code included in the package)

Lines of code

  • {cloc} (counts blank lines, comment lines, and physical lines of source code in source files)

Refactoring

  • {refactor} (to check speed and performance of both the original and refactored version of code)

Code performance โฑ๏ธ

Benchmarking

  • {bench} (provides high precision benchmarks for R expressions)

  • {microbenchmark} (provides infrastructure to accurately measure and compare the execution time of R expressions)

  • {tictoc} (provides functions for timing R scripts)

  • {touchstone} (benchmarking pull requests)

Profiling

  • {profvis} (to profile and visualize profiling data)

  • {proffer} (to create friendlier, faster visualizations for profiling data)

  • {jointprof} (to profile packages with native code in C, C++, Fortran, etc.)

Dependency Management โš–๏ธ

  • {pkgdepends} (to find recursive dependencies of from various sources)

  • {deepdep} (to visualize and explore package dependencies)

  • {itdepends} (to assess usage, measure weights, visualize proportions, and assist removal of dependencies)

  • {DependenciesGraphs} (to visualize package dependencies)

  • {DependencyReviewer} (to investigate packages during code review by looking at their dependencies)

  • {deps} (to manage source code dependencies by decorating R code with roxygen-style comments)

  • {pkgnet} (to build a graph representation of a package and its dependencies)

  • {functiondepends} (to find functions in an unstructured directory and explore their dependencies)

  • {pkgndep} (checks the heaviness of the packages used)

  • {oysteR} (to secure package against insecure dependencies)

  • {attachment} (to deal with package dependencies during package development)

CRAN/Bioconductor checks, submission, and status ๐Ÿ“ฌ

  • {rcmdcheck} (to run R CMD check form R programmatically)

  • {BiocCheck} (to run Bioconductor-specific package checks)

  • {rhub} (to run R CMD check on CRAN architectures)

  • {checkhelper} (to help avoid problems with CRAN submissions)

  • {foghorn} (to check for results and submission portal status)

  • {urlchecker} (to checks for URL rot)

Usage ๐Ÿ™ˆ

CI/CD ๐Ÿ“Ÿ

CI/CD: continuous integration and either continuous delivery or continuous deployment

Security/Privacy ๐Ÿ‘ฎ

  • {digest} (for the creation of hash digests of arbitrary R objects)

  • {hash} (implements a data structure similar to hashes in Perl and dictionaries in Python but with a purposefully R flavor)

  • {gpg} (GNU privacy guard for R)

Build systems

  • {fakemake} (to mock Unix Make build system in case it is unavailable)

Validation frameworks

  • {valtools} (in clinical research and drug development)

Debugging ๐Ÿ”ญ

  • {debugme} (provides helpers to specify debug messages as special string constants, and control debugging of packages via environment variables)

  • {debugr} (tools to print out the value of R objects/expressions while running an R script)

  • {winch} (provides stack traces for call chains that cross between R and C/C++ function calls)

  • {flow} (to visualize as flow diagrams the logic of functions, expressions, or scripts, which can ease debugging)

  • {boomer} (provides debugging tools to inspect the intermediate steps of a call)

Input validation ๐Ÿ”ฌ

  • {checkmate} (fast and versatile argument checks)

  • {assertthat} (to declare the pre and post conditions that you code should satisfy and to produce friendly error messages)

  • {assertive} (provides readable check functions to ensure code integrity)

  • {pkgcond} (better error messages for package users)

  • {dreamerr} (a simple and intuitive, yet powerful and flexible, way to check the arguments passed to a function and to offer informative error messages)

  • {erify} (to check arguments and generate readable error messages)

  • {validate} (to check whether data lives up to expectations based on the domain-specific knowledge)

Package metadata ๐Ÿ–จ

  • {codemetar} (provides utilities to generate, parse, and modify codemeta.jsonld files automatically for R packages), or {codemeta} (a leaner version of {codemetar})

  • {cffr} (provides utilities to generate, parse, modify and validate CITATION.cff files automatically for R packages)

  • {citation} (creates CITATION.cff from R package metadata)

  • {pkgapi} (to create the map of function calls in a package)

  • {packagemetrics} (for comparing among packages)

  • {devtoolbox} (to create a summary report for R package and to extract dependency statistics in a tidy data frame)

  • {pkgattrs} (useful for getting information on the contents of any R package)

  • {foreman} (for unpacking, interrogating and subsetting R packages)

  • {sessioninfo} (to include R session information)

Reverse dependency checks ๐Ÿ“กโšฐ๏ธ

  • {revdepcheck} (for automated, isolated, reverse dependency checking)

  • {xfun} (specifically, xfun::rev_check())

Gratitude ๐Ÿ™๐Ÿ’Œ

To thank the contributors or maintainers of packages you rely on.

Docker container ๐Ÿ›

  • {containerit} (to package R script/session/workspace and all dependencies as a Docker container by generating a suitable Dockerfile)

  • {usethat} (to automate analytic project setup tasks)

Integration with other languages ๐Ÿ”—

C++

Fortran

Python

Rust

.NET Framework

JavaScript/HTML/CSS

Julia

Upkeep ๐Ÿงน

  • {TODOr} (RStudio addin to list things that you need to do or change)

Sundry ๐Ÿ—’

  • {gpttools} (RStudio addin that allows using chatGPT to automate writing documentation, tests, etc.)

  • {prefixer} (prefix function with their namespace )

  • {options} (provides simple mechanisms for defining and interpreting package options)

  • {rstudioapi} (to conditionally access the RStudio API from CRAN packages)

  • {rcheology} (to access data on base packages for previous versions of R)

  • {gitignore} (to fetch gitignore templates)

  • {DIZutils} (helpers for packages dealing with database connections)

Session information

::: {.cell}

:::

::: {.cell details.summary='Quarto version'}

Quarto version
[1] '1.4.122'

:::

::: {.cell details.summary='Session details'}

Session details
โ”€ Session info โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 setting  value
 version  R version 4.3.0 (2023-04-21)
 os       Ubuntu 22.04.2 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  C.UTF-8
 ctype    C.UTF-8
 tz       UTC
 date     2023-06-04
 pandoc   3.1.1 @ /usr/bin/ (via rmarkdown)

โ”€ Packages โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 package     * version    date (UTC) lib source
 cli           3.6.1      2023-03-23 [1] RSPM
 clipr         0.8.0      2022-02-22 [1] RSPM
 desc          1.4.2      2022-09-08 [1] RSPM
 details     * 0.3.0      2022-03-27 [1] RSPM
 digest        0.6.31     2022-12-11 [1] RSPM
 evaluate      0.21       2023-05-05 [1] RSPM
 fastmap       1.1.1      2023-02-24 [1] RSPM
 htmltools     0.5.5      2023-03-23 [1] RSPM
 httr          1.4.6      2023-05-08 [1] RSPM
 jsonlite      1.8.4      2022-12-06 [1] RSPM
 knitr         1.43       2023-05-25 [1] RSPM
 later         1.3.1      2023-05-02 [1] RSPM
 magrittr      2.0.3      2022-03-30 [1] RSPM
 png           0.1-8      2022-11-29 [1] RSPM
 processx      3.8.1      2023-04-18 [1] RSPM
 ps            1.7.5      2023-04-18 [1] RSPM
 quarto        1.2.0.9000 2023-05-21 [1] Github (quarto-dev/quarto-r@a4b4f93)
 R6            2.5.1      2021-08-19 [1] RSPM
 Rcpp          1.0.10     2023-01-22 [1] RSPM
 rlang         1.1.1      2023-04-28 [1] RSPM
 rmarkdown     2.22       2023-06-01 [1] RSPM
 rprojroot     2.0.3      2022-04-02 [1] RSPM
 rstudioapi    0.14       2022-08-22 [1] RSPM
 sessioninfo   1.2.2      2021-12-06 [1] any (@1.2.2)
 withr         2.5.0      2022-03-03 [1] RSPM
 xfun          0.39       2023-04-20 [1] RSPM
 xml2          1.3.4      2023-04-27 [1] RSPM
 yaml          2.3.7      2023-01-23 [1] RSPM

 [1] /home/runner/work/_temp/Library
 [2] /opt/R/4.3.0/lib/R/site-library
 [3] /opt/R/4.3.0/lib/R/library

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

:::

More Repositories

1

ggstatsplot

Enhancing {ggplot2} plots with statistical analysis ๐Ÿ“Š๐Ÿ“ฃ
R
1,730
star
2

statsExpressions

Tidy data frames and expressions with statistical summaries ๐Ÿ“œ
R
295
star
3

kittyR

Bring those kitties and their meows to R console ๐Ÿˆ๐Ÿˆ๐Ÿˆ
R
47
star
4

broomExtra

Helpers for regression analyses using `{broom}` & `{easystats}` packages ๐Ÿ“ˆ ๐Ÿ”
R
46
star
5

pairwiseComparisons

Pairwise comparison tests for one-way designs ๐Ÿ”ฌ๐Ÿ“
R
45
star
6

groupedstats

Grouped statistical analysis in a tidy way ๐Ÿ”๐Ÿ’ชโ™ป
R
45
star
7

dry-r-package-development

Tips on not repeating yourself during R package development
HTML
22
star
8

RmarkdownTips

Collection of my tweets with RMarkdown/Quarto tips and tricks
HTML
21
star
9

tidyBF

Tidy wrapper around `BayesFactor` R package (archived)
R
18
star
10

preventive-r-package-care

How to build automation infrastructure to improve user experience and development workflow of R packages
HTML
17
star
11

intro-to-snapshot-testing

Introduction to snapshot (aka golden) testing (in R)
HTML
15
star
12

Advanced-R-exercises

Solutions to "Advanced R" (2nd ed.) exercises (unofficial) ๐Ÿ“–โœ๏ธ
HTML
15
star
13

R-Function-A-Day-book

Collection of tweets from "R Function A Day" account
HTML
15
star
14

Indra_CV

LaTeX scripts for my CV and Rรฉsumรฉ
TeX
14
star
15

ggstatsplot_slides

An Introductory Tutorial on {ggstatsplot}: {ggplot2} Plots with Statistics ๐Ÿ‘จโ€๐Ÿซ
14
star
16

second-hardest-cs-thing

Thoughts on how to name things for software development
HTML
13
star
17

Practical-SQL-exercises

Exercises from "Practical SQL" (1st Ed.)
PLpgSQL
13
star
18

codeswitchR

A list of helpful R packages to learn other programming languages or workflows
HTML
8
star
19

IndrajeetPatil

My GitHub profile README
8
star
20

dotInternals

Prepend Internal Package Function Names With a Dot
R
5
star
21

refactoring-ggstatsplot

Slides on lessons learned while refactoring {ggstatsplot} package
4
star
22

collectify

Collect your favourite things in one place!
JavaScript
4
star
23

famtrack

Track your family history in a fun way!
Handlebars
2
star
24

Repro-workshop

HTML
1
star
25

minimalReprex

Minimal reprexes for {pkgdown} issues
R
1
star
26

save-indy

Save Indiana Jones using JavaScript!
JavaScript
1
star