Join us for
RADAR: AI Edition

simba (version 0.3-4)

mad: Make binary dummy variables out of a factor vector

Description

Make binary dummy variables out of a factor vector

Usage

mad(x, red = TRUE)

Arguments

x
A factor vector. Or a vector that is convertible to a factor.
red
Logical. Shall redundancy be retained? When a factor variable is broken down to binary dummy variables it is typically not wanted to transfer all levels to 0/1 vectors but to skip the last level because the information is already contained in the sum of t

Value

  • Returns a data.frame with binary data (0/1) with as many (n) rows as x has levels (with red=TRUE) or with n-1 levels when red=FALSE.

encoding

UTF-8

References

Legendre & Legendre 1998. Numerical ecology. Elsevier

See Also

sim, mps

Examples

Run this code
## load bernina data
data(bernina)
## have a look at summit$year
summits$year
## make binary dummies from that
mad(summits$year)

Run the code above in your browser using DataLab