Skip to content

forcats

1.0.1

Tools for Working with Categorical Variables (Factors)

250packages dependsuggested by 130
6.8Mdownloads / year
99.6%test coverage
13/13flavors OK

Overview

About

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').

Changes in 1.0.1
  • 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

CRAN checks
13OK
Slowest check: 1.7 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.0.1
READMEYes · 301 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 1.0.1Citation fileNoWebsiteYes · pkgdown
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

6.8M
CRAN downloads in the past year
Rank #136 · ~18.8K/day · ~570.8K/mo
Daily download trend is not available in this view yet.
475.1K30 days
1.3M90 days
6.8M1 year
Compare downloads with other packages →
Also on98.7K r2u148 autocran1.2M conda_forge19K c2d4u

Repository

557Stars
135Forks
21Open issues
6Open PRs
10Releases
383Commits
59Commit identities
rfactortidyverse
383 commits · Last activity 2026-02-02 · 0% stars, 30d · Default branch at 1.0.1.9000, ahead of CRAN 1.0.1 (checked 2026-10-11)
Responsiveness
How these are sampled
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

2025-09-18 · 5502026-09-04 · 557
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (5)
Code of conductContributing guideIssue templatesCODEOWNERSSupport guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-02-02 · The repository has a site deploy workflow

pkgdown site last built 2025-09-25

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 3 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (3)
AirVS CodeRStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
14 external dependencies (excludes base and recommended)

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.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none

Datasets

People & History

People (2)
Author, Maintainer since 0.1.0 (2016)
Copyright holder, Funder · added in 1.0.1
Listed in earlier versions (1)
RStudio
no longer listed · 0.1.0 to 1.0.0
Releases (10)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.0.1Latest
    record
    2025-09-25 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 1.0.0
    record
    2023-01-29 · diff ↗ ·
    added 2 exports
    fct_na_level_to_value, fct_na_value_to_level
  • 0.5.2
    record
    2022-08-20 · diff ↗ ·
    added 1 export
    fct
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 0.5.1
    record
    2021-01-27 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 0.5.0
    record
    2020-03-01 · diff ↗ ·
    added 4 exports
    fct_lump_lowfreq, fct_lump_n, fct_lump_prop, first2
  • R
    R 3.6.0 released · 2019-04-26
  • 0.4.0
    record
    2019-02-17 · diff ↗ ·
    added 4 exports
    fct_cross, fct_inseq, fct_lump_min, fct_match
  • R
    R 3.5.0 released · 2018-04-23
  • 0.3.0
    record
    2018-02-19 · diff ↗ ·
    added 1 export
    last2
Show 5 earlier eventsHide 5 earlier events
  • R
    R 3.4.0 released · 2017-04-21
  • 0.2.0
    record
    2017-01-23 · diff ↗ ·
    added 3 exports
    as_factor, fct_other, fct_relabel
  • 0.1.1
    record
    2016-09-16 · diff ↗
  • 0.1.0
    record
    2016-08-29
  • R
    R 3.3.0 released · 2016-05-03

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")
Wickham, H., & Posit Software, PBC. (2025). forcats: Tools for Working with Categorical Variables (Factors) (Version 1.0.1) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

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

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.

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