dummy.code: Convert a factor to a matrix of dummy codes

Description Usage Arguments Value Examples

View source: R/dummy.code.R

Description

Converts a factor (categorical) variable to a matrix of dummy codes using a 1 of C-1 binary coding scheme.

Usage

1

Arguments

x

a factor variable.

Value

a matrix with the number of rows equal to the number of cases in x and the number of columns equal to one minus the number of factors in x. The last factor serves as the reference group.

Examples

1
  print(dummy.code(iris$Species))

CaDENCE documentation built on May 19, 2017, 9:20 a.m.

Search within the CaDENCE package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.