forcats
1.0.1Tools for Working with Categorical Variables (Factors)
Overview
Helpers for reordering factor levels (including moving specified levels to front, ordering by first appearance, reversing, and randomly shuffling), and tools for modifying factor levels (including collapsing rare levels into other, 'anonymising', and manually 'recoding').
fct_cross()now varies the levels in the last factor fastest (@Adam-AKong, #373).- Functions that create a new factor (e.g.
lvls_expand(),lvls_reorder(),fct_lump_n(),fct_drop()) now preserves the class of the original object in addition to the attributes (#83). - forcats now requires R 4.1.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 29 (3 internal)includes a package overview page
- Examples that run
- 100%27 run in a plain check
- Exported functions with examples
- 96%
- Documented parameters
- 97%
- Return-value docs
- 19%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 69%
- Median days to close, 50 most recently updated closed issues
- 248
- 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
19 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/tidyverse/forcats on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-02-02 · The repository has a site deploy workflow
pkgdown site last built 2025-09-25
Show all practicesHide 3 practices
Dependencies
Installing forcats adds 10 packages (7 with compiled code, 4.0 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 202 more dependents and 130 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.0.1Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 1.0.0
- 0.5.2
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.5.12021-01-27 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.5.0
- RR 3.6.0 released · 2019-04-26
- 0.4.0
- RR 3.5.0 released · 2018-04-23
- 0.3.0
Package metadata
- First published
- 2016-08-29
- Total releases
- 10 / 10 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 0.5.1
- Minimum R
- ≥ 4.1
- Bundled data
- 72 KB / 1 file
- Download size
- 288 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("forcats")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-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.