Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables

Creates dummy columns from columns that have categorical variables (character or factor types). You can also specify which columns to make dummies out of, or which columns to ignore. Also creates dummy rows from character, factor, and Date columns. This package provides a significant speed increase from creating dummy variables through model.matrix().

CRAN_Status_Badge AppVeyor Build Status Build Status


The goal of fastDummies is to quickly create dummy variables (columns) and dummy rows. Creating dummy variables is possible through base R or other packages, but this package is much faster than those methods.


To install this package, use the code
# install.packages("devtools")



There are two functions in this package:

  • dummy_cols() lets you make dummy variables (dummy_columns() is a clone of dummy_cols())
  • dummy_rows() which lets you make dummy rows.


fastDummies 1.0.0

  • Reduces number of parameter that were in previous version.

  • Significant speed increases for both dummy_cols() and dummy_rows() functions.

  • dummy_cols() now accepts numeric columns.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.1.0 by Jacob Kaplan, 3 months ago

Report a bug at

Browse source code at

Authors: Jacob Kaplan [aut, cre], Benjamin Schlegel [ctb]

Documentation:   PDF Manual  

GPL license

Imports data.table, tibble

Suggests testthat, knitr, rmarkdown, covr

See at CRAN