Learn R Programming

kamila (version 0.1.2)

dummyCodeFactorDf: Dummy coding of a data frame of factor variables

Description

Given a data frame of factor variables, this function returns a numeric matrix of 0--1 dummy-coded variables.

Usage

dummyCodeFactorDf(dat)

Arguments

dat

A data frame of factor variables

Value

A numeric matrix of 0--1 dummy coded variables

Examples

Run this code
# NOT RUN {
dd <- data.frame(a=factor(1:8), b=factor(letters[1:8]), stringsAsFactors = TRUE)
dummyCodeFactorDf(dd)
# }

Run the code above in your browser using DataLab