Learn R Programming

GDAtools (version 1.0)

dichotom: Dichotomizes the variables in a data frame

Description

Dichotomizes the variables in a data frame exclusively composed of categorical variables

Usage

dichotom(data, out = "numeric")

Arguments

Value

  • Returns a data frame with dichotomized variables. The number of columns is equal to the total number of categories in the input data.

Examples

Run this code
## Dichotomizes 'Music' example data frame
data(Music)
dic <- dichotom(Music[,1:5])
str(dic)

## with output variables in factor format
dic <- dichotom(Music[,1:5], out='factor')
str(dic)

Run the code above in your browser using DataLab