forcats: Tools for Working with Categorical Variables (Factors)

Share:

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

Author
Hadley Wickham [aut, cre], RStudio [cph]
Date of publication
2016-09-16 00:15:04
Maintainer
Hadley Wickham <hadley@rstudio.com>
License
GPL-3
Version
0.1.1
URLs

View on CRAN

Man pages

fct_anon
Anonymise factor levels
fct_c
Concatenate factors, unioning levels.
fct_collapse
Collapse factors into groups.
fct_count
Count entries in a factor
fct_drop
Drop unnused levels
fct_expand
Add additional levels to a factor
fct_explicit_na
Make missing values explicit
fct_inorder
Reorders levels in order of first appearance or frequency.
fct_lump
Lump together least/most common levels into "other".
fct_recode
Change the levels of a factor
fct_relevel
Change the order of levels in a factor
fct_reorder
Reorder the levels of a function according to another...
fct_rev
Reverse the levels of a factor
fct_shift
Shift the order of levels of a factor
fct_shuffle
Randomly permute the levels of a factor
fct_unify
Unify the levels in a list of factors
fct_unique
Unique values of a factor
gss_cat
A sample of categorical variables from the General Social...
lvls
Low-level functions for manipulating levels
lvls_union
Find all levels in a list of factors
pipe
Pipe operator

Files in this package

forcats
forcats/tests
forcats/tests/testthat.R
forcats/tests/testthat
forcats/tests/testthat/helper-lump.R
forcats/tests/testthat/test-fct_lump.R
forcats/tests/testthat/test-fct_reorder.R
forcats/tests/testthat/test-lvls.R
forcats/tests/testthat/test-fct_recode.R
forcats/tests/testthat/test-fct_relevel.R
forcats/NAMESPACE
forcats/NEWS.md
forcats/data
forcats/data/gss_cat.rda
forcats/R
forcats/R/relevel.R
forcats/R/shift.R
forcats/R/reorder.R
forcats/R/utils.R
forcats/R/drop.R
forcats/R/count.R
forcats/R/c.R
forcats/R/shuffle.R
forcats/R/data.R
forcats/R/lump.R
forcats/R/recode.R
forcats/R/unique.R
forcats/R/rev.R
forcats/R/lvls.R
forcats/R/expand.R
forcats/R/collapse.R
forcats/R/explicit_na.R
forcats/R/anon.R
forcats/README.md
forcats/MD5
forcats/DESCRIPTION
forcats/man
forcats/man/pipe.Rd
forcats/man/fct_count.Rd
forcats/man/fct_relevel.Rd
forcats/man/fct_collapse.Rd
forcats/man/fct_recode.Rd
forcats/man/gss_cat.Rd
forcats/man/lvls.Rd
forcats/man/fct_drop.Rd
forcats/man/fct_reorder.Rd
forcats/man/lvls_union.Rd
forcats/man/fct_unify.Rd
forcats/man/fct_rev.Rd
forcats/man/fct_expand.Rd
forcats/man/fct_anon.Rd
forcats/man/fct_unique.Rd
forcats/man/fct_shuffle.Rd
forcats/man/fct_shift.Rd
forcats/man/fct_inorder.Rd
forcats/man/fct_c.Rd
forcats/man/fct_explicit_na.Rd
forcats/man/fct_lump.Rd