Skip to content

forcats

1.0.1

Tools for Working with Categorical Variables (Factors)

373packages depend
7.6Mdownloads / year
99.6%test coverage
13/13checks pass

Overview

About
Maintained by Hadley WickhamFirst published 2016-08-2910 releasesCRAN page ↗GitHub ↗

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

Install

Health

CRAN checks
13OK
Slowest check: 1.8 min · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 0.69
99.6%
Coverage · measured lines
97%
Documentation · exports
6
Dependencies · direct
Check history
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 301 wordsVignettesYes · dynamicpkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
97%
Return-value docs
19%
References docs
0%

Downloads

7.6M
CRAN downloads in the past year
Rank #137 · ~20.8K/day · ~633K/mo
Daily download trend is not available in this view yet.
381.1K30 days
1.4M90 days
7.6M1 year
Compare downloads with other packages →
Also on76.5K r2u199 autocran826.8K conda_forge15.9K c2d4u

Repository

Repository
559Stars
135Forks
21Open issues
6Open PRs
10Releases
383Commits
59Contributors
rfactortidyverse
383 commits · Last activity 2026-02-02 · +0.2% stars, 30d

Stars over time

2025-06-01 · 5482026-07-07 · 559

Repository practices

Upstream repositoryBeta

13 development-tooling and community-health practices detected across 7 families in the upstream repository

Checks run against github.com/tidyverse/forcats on 2026-07-19.

Continuous integration (1)
GitHub Actions
Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdrevdep/
Docs source (1)
README.Rmd
Show all practices
Lint, format, editor (3)
AirVS CodeRStudio project
Coverage (2)
Codecov.covrignore
Governance and community (3)
Issue templatesCODEOWNERSSupport guide
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
14 external dependencies (excludes base and recommended)
Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none

Code & Tests

Code Composition
R 3,872 (68%)Rd 1,105 (19%)Markdown 507 (9%)Vignettes 220 (4%)
Code characteristics
Object systems
S34
Cyclomatic complexity
2.0 median / 23 max
Test cases
149 / 0.69 per code line

Test coverage

Line coverage

100%

Expression

99.5%

Tests / Examples

99.6% / 74% ex

Functions

112 38 exported

Complexity

2.7 avg / 23 max

Call network

112 nodes / 163 edges

Loading call graph…

Lowest coverage

112 functions
FunctionCycloCoverage
as_factor.numeric10%
lump_cutoff383%
as_factor exp1100%
fct exp3100%
fct_anon exp1100%
fct_c exp2100%

Datasets

Bundled datasets · 1
NameClassRows × ColsAlso ships in
gss_cattbl_df/tbl/data.frame21,483 × 9

People & History

People (2)
Maintainer (1)
Author, Maintainer
Authors (1)
Author, Maintainer
Copyright holders (1)
Copyright holder, Funder · added in 1.0.1
Funders (1)
Copyright holder, Funder · added in 1.0.1
Listed in earlier versions (1)
no longer listed · 0.1.0 to 1.0.0
Package Timeline

10 releases. Pick two to compare their code metrics. R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • 1.0.1Latest
    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
    2023-01-29 · diff ↗
  • 0.5.2
    2022-08-20 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 0.5.1
    2021-01-27 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 0.5.0
    2020-03-01 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 0.4.0
    2019-02-17 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • 0.3.0
    2018-02-19 · diff ↗
Show 5 earlier events
  • R
    R 3.4.0 released · 2017-04-21
  • 0.2.0
    2017-01-23 · diff ↗
  • 0.1.1
    2016-09-16 · diff ↗
  • 0.1.0
    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
Minimum R
≥ 4.1
Bundled data
72 KB / 1 file
Download size
288 KB
Installed size
not tracked yet
With dependencies
not tracked yet
Report a problem with this page →