Skip to content

Encapsulated Classes with Reference Semantics

695packages dependsuggested by 48
21.9Mdownloads / year
–test coverage
12/13flavors OK

Overview

About

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.

Changes in 2.6.1
  • Closed #298: In .DollarNames.R6(), avoid use of NextMethod(). This is to work around a compatibility issue with RStudio IDE. (#299)

From NEWS.md in the release

Install

Health

CRAN checks
1ERROR12OK
Check messages
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

CRAN check page ↗

Slowest check: 1.1 min · r-devel-windows-x86_64
Status changes
  • ERROR12 OK, 1 ERRORNow
  • ERROR13 OK, 1 ERROR2026-03-10
Advisories

none known

Documentation

In release 2.6.1
READMEYes · 272 wordsVignettes· In the repository, left out of the releaseNEWSYes · 33% structured · mentions 2.6.1Citation fileNoWebsiteYes · pkgdown
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

21.9M
CRAN downloads in the past year
Rank #6 · ~60K/day · ~1.8M/mo
Daily download trend is not available in this view yet.
1.7M30 days
5.8M90 days
21.9M1 year
Compare downloads with other packages →
Also on259.2K r2u146 autocran2.4M conda_forge24.8K c2d4u

Repository

r-lib/r6 ↗Organization: r-lib
426Stars
59Forks
53Open issues
3Open PRs
4Releases
601Commits
20Commit identities
r
601 commits · Last activity 2025-10-20 · +0.2% stars, 30d · Default branch at 2.6.1.9000, ahead of CRAN 2.6.1 (checked 2026-10-11)
Responsiveness
How these are sampled
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

2025-07-14 · 4212026-10-03 · 426
PracticesBeta

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.

Continuous integration (1)
GitHub Actions
Governance and community (1)
CODEOWNERS
Docs source (3)
pkgdown

GitHub Pages site last deployed 2025-10-20 · The repository has a site deploy workflow

pkgdown site last built 2025-02-19

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 2 practices
Lint, format, editor (1)
RStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
2 external dependencies (excludes base and recommended)

Installing R6 adds no packages beyond those that come with R.

Depends (1)
R >= 3.6
Imports (0)
none
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none

People & History

People (2)
Author, Maintainer
Copyright holder, Funder · added in 2.6.0

Maintainer since 1.0.1 (2014)

Releases (17)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 2.6.1Latest
    record
    2025-02-15 · current release · diff ↗
  • 2.6.0
    record
    2025-02-12 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 2.5.1
    record
    2021-08-19 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 2.5.0
    record
    2020-10-28 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 2.4.1
    record
    2019-11-12 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 2.4.0
    record
    2019-02-14 · diff ↗
  • 2.3.0
    record
    2018-10-04 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
Show 14 earlier eventsHide 14 earlier events

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
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("R6")
Chang, W., & Posit Software, PBC. (2025). R6: Encapsulated Classes with Reference Semantics (Version 2.6.1) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for R6 version 2.6.1 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy