Skip to content
/ forcats Public
forked from tidyverse/forcats

🐈🐈🐈🐈: tools for working with categorical variables (factors)

Notifications You must be signed in to change notification settings

rtaph/forcats

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

78 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

forcats 🐈🐈🐈🐈

CRAN_Status_Badge Travis-CI Build Status Coverage Status

forcats provides tools for categorical variables (forcats is an anagram of factors).

Installation

You can install forcthe released version of forcats from CRAN with:

install.packages("forcats")

Or the development versionm github with:

# install.packages("devtools")
devtools::install_github("hadley/forcats")

Key functions:

Change order of levels:

Change value of levels:

Add new levels:

A few other helpers:

  • fct_c(): concatenate factors using union of levels.

  • fct_count():
    count occurences of levels, optionally sorting by frequency.

  • fct_unify():
    ensure list of factors share the same levels.

  • fct_unique(): compute from levels of factor.

  • fct_drop(): drop levels without data (same as base::droplevels()).

  • lvls_union(): finds union of levels from list of factors.

About

🐈🐈🐈🐈: tools for working with categorical variables (factors)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 100.0%