forcats: Tools for Working with Categorical Variables (Factors)

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

Version: 1.0.0
Depends: R (≥ 3.4)
Imports: cli (≥ 3.4.0), glue, lifecycle, magrittr, rlang (≥ 1.0.0), tibble
Suggests: covr, dplyr, ggplot2, knitr, readr, rmarkdown, testthat (≥ 3.0.0), withr
Published: 2023-01-29
Author: Hadley Wickham [aut, cre], RStudio [cph, fnd]
Maintainer: Hadley Wickham <hadley at>
License: MIT + file LICENSE
NeedsCompilation: no
Materials: README NEWS
CRAN checks: forcats results


Reference manual: forcats.pdf
Vignettes: Introduction to forcats


Package source: forcats_1.0.0.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release (arm64): forcats_1.0.0.tgz, r-oldrel (arm64): forcats_1.0.0.tgz, r-release (x86_64): forcats_1.0.0.tgz, r-oldrel (x86_64): forcats_1.0.0.tgz
Old sources: forcats archive

Reverse dependencies:

Reverse imports: activAnalyzer, adestr, adventr, animalcules, animaltracker, aplotExtra, apyramid, autoMrP, BeeBDC, bibliometrix, BREADR, brinton, broom.mixed, bupaR, burnr, calendR, calendRio, cats, causact, ccostr, CellaRepertorium, CGPfunctions, cheese, ChromSCape, clustringr, CMMs, cocktailApp, codebook, CoGAPS, CohortPlat, ComPrAn, CoNI, correlationfunnel, cpsvote, crosstable, dabestr, dados, datos, DCPO, describedata, DescrTab2, descstat, dfoliatR, EasyCellType, echoice2, eHDPrep, elaborator, epe4md, epikit, evalITR, explore, extraChIPs, ezplot, fcaR, fdacluster, fedmatch, fedup, ffp, finalfit, FMAT, forestecology, framecleaner, FRI, fude, funneljoin, gapclosing, gemtc, genogeographer, gfilmm, GGally, ggblanket, ggdag, ggplate, ggseqplot, ggstats, ggstream, glancedata, glmmfields, glmSparseNet, globaltrends, GRaNIE, gtreg, gtsummary, haven,, healthyR.ts, hermes, HiLDA, injurytools, ino, iNZightTools, iNZightTS, iotables, iraceplot, IRexamples, ISAnalytics, janus, jmastats, kayadata, labNorm, LACE, lactater, lipidr, lmeresampler, madshapR, markovmix, matchmaker, mbRes, metabolic, metaconfoundr, microbiomeExplorer, migest, miRetrieve, mlfit, modeltime, modeltime.resample, MOFA2, mpwR, mshap, multinma, naniar, NanoMethViz, NeuroDecodeR, nevada, ngsReports, NMTox, noaastormevents, npcs, OBL, OlinkAnalyze, OlympicRshiny, Omixer, openairmaps, opitools, OralOpioids, OutliersO3, palaeoSig, PanomiR, partition, PEIMAN2, PERK, PieGlyph, pirouette, play, pollster, prcr, prettyglm, processmapR, processpredictR, protti, psmineR, r2dii.plot, r4ss, rbenvo, RCT, RSDA, safetyCharts, SafeVote, sccomp, scCustomize, scipub, SCnorm, SEERaBomb, sense, seqArchRplus, sfcr, ShapleyOutlier, sherlock, SIAmodules, simaerep, simlandr, simplanonym, simplecolors, sitar, smdi, snap,, stevemisc, suddengains, survivalAnalysis, survParamSim, SWTools, tern, testcorr, TextForecast, tfrmt, tfrmtbuilder, tidyAML, tidycat, tidycomm, tidync, tidysynth, tidytidbits, tidytlg, tidyverse, timetk, Tplyr, twoxtwo, UCSCXenaShiny, umiAnalyzer, unheadr, unpivotr, visdat, vvshiny, wcde, weed, wrappedtools, xadmix
Reverse suggests: alone, BaseSet, bench, BindingSiteFinder, broom.helpers, bruceR, catfun, constructive, cowplot, csdata, DAPAR, DisImpact, dm, domir, DSjobtracker, eph, exuber, ferrn, finalsize, forwards, genekitr, GenomicSuperSignature, ggdist, ggResidpanel, ggridges, glue, gratia, httk, i2dash, industRial, iNZightPlots, isoorbi, jlmerclusterperm, konfound, learningtower, lvmisc, memes, MicrobiotaProcess, mikropml, mtsta, multifunc, multiverse, naryn, NHSRdatasets, nzelect, ohenery, openintro, outcomerate, pdxTrees, phenopath, pixarfilms, plotly, PPtreeregViz, projects, questionr, raw, refdb, robber, rTPC, SCpubr, simstandard, slendr, sparseMVN, statquotes, summarytools, survivoR, sweep, tidybayes, tidyEmoji, tidyHeatmap, tidyjson, tidylog, tidypaleo, tidyquant, treeheatr, unusualprofile, visR, vroom, washi, whippr


Please use the canonical form to link to this page.