Factor2Binary function

Converts a Factor into its indicator matrix

Converts a Factor into its indicator matrix

Converts a factor into a binary matrix with as many columns as categories of the factor

Factor2Binary(y, Name = NULL)

Arguments

  • y: A factor
  • Name: Name to use in the final matrix

Returns

An indicator binary matrix

Author(s)

Jose Luis Vicente Villardon

Examples

y=factor(c(1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1)) Factor2Binary(y)
  • Maintainer: Jose Luis Vicente Villardon
  • License: GPL (>= 2)
  • Last published: 2023-11-21

Useful links