transfo_quali: transfo_quali()

View source: R/transfo_quali.R

transfo_qualiR Documentation

transfo_quali()

Description

A function that transforms a factor of n(>1) levels in (n-1) binary variables.

Usage

transfo_quali(x, labx = NULL)

Arguments

x

a factor

labx

a new label for the generated binary variables (By default the name of the factor is conserved)

Value

A matrix of (n-1) binary variables

Author(s)

Gregory Guernec

otrecod.pkg@gmail.com

Examples


treat <- as.factor(c(rep("A", 10), rep("B", 15), rep("C", 12)))
treat_bin <- transfo_quali(treat, "trt")


OTrecod documentation built on Oct. 5, 2022, 5:06 p.m.