Encapsulated Classes with Reference Semantics
Overview
Creates classes with reference semantics, similar to R's built-in reference classes. Compared to reference classes, R6 classes are simpler and lighter-weight, and they are not built on S4 classes so they do not require the methods package. These classes allow public and private members, and they support inheritance, even when the classes are defined in different packages.
- Closed #298: In
.DollarNames.R6(), avoid use ofNextMethod(). This is to work around a compatibility issue with RStudio IDE. (#299)
From NEWS.md in the release
Install
Health
ERRORtestsr-oldrel-macos-arm64
Running ‘testthat.R’ [0s/1s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(R6)
>
> test_check("R6")
Error in loadNamespace(x) : there is no package called 'cli'
Calls: test_check ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted- ERROR12 OK, 1 ERRORNow
- ERROR13 OK, 1 ERROR2026-03-10
Documentation
- Help pages
- 4 (1 internal)includes a package overview page
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 50%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 72%
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
8 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/r-lib/r6 on 2026-10-11.
GitHub Pages site last deployed 2025-10-20 · The repository has a site deploy workflow
pkgdown site last built 2025-02-19
Show all practicesHide 2 practices
Dependencies
Installing R6 adds no packages beyond those that come with R.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 647 more dependents and 48 packages that suggest it on CRAN ↗
Code & Tests
People & History
Maintainer since 1.0.1 (2014)
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 2.6.1Latest
- 2.6.02025-02-12 · diff ↗
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 2.5.12021-08-19 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 2.5.02020-10-28 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 2.4.12019-11-12 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 2.4.02019-02-14 · diff ↗
- 2.3.02018-10-04 · diff ↗
- RR 3.5.0 released · 2018-04-23
Show 14 earlier eventsHide 14 earlier events
- 2.2.22017-06-17 · diff ↗
- 2.2.12017-05-10 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 2.2.0
- 2.1.32016-08-19 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 2.1.22016-01-26 · diff ↗
- 2.1.12015-08-19 · diff ↗
- 2.1.02015-07-04 · diff ↗
- RR 3.2.0 released · 2015-04-16
- 2.0.12014-10-29 · diff ↗
- 2.02014-08-19 · diff ↗
- 1.0.12014-07-17
- RR 3.1.0 released · 2014-04-10
Package metadata
- First published
- 2014-07-17
- Total releases
- 17 / 12 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.6
- Download size
- 63 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("R6")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.