dichotom: Dichotomizes the variables in a data frame

View source: R/dichotom.R

dichotomR Documentation

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

data

data frame of categorical variables

out

character string defining the format for dichotomized variables in the output data frame. Format may be 'numeric' or 'factor' (default is 'numeric').

Value

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

Author(s)

Nicolas Robette, Julien Barnier

Examples

## 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)

GDAtools documentation built on March 18, 2022, 5:13 p.m.