Dataframe2BinaryMatrix: Converts a Data Frame into a Binary Data Matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/Dataframe2BinaryMatrix.R

Description

Converts a Data Frame into a Binary Data Matrix

Usage

1
Dataframe2BinaryMatrix(dataf, cuttype = "Median", cut = NULL, BinFact = TRUE)

Arguments

dataf

data.frame to be converted

cuttype

Type of cut point for continuous variables. Must be "Median" or "Mean". Does not have any effect for factors

cut

Personalized cut value for continuous variables.

BinFact

Should I treat a factor with two levels as binary. This means that only a single dummy rather than two is used

Details

The function converts a data frame into a Binary Data Matrix (A matrix with entries either 0 or 1).

Factors with two levels are directly transformed into a column of 0/1 entries.

Factors with more than two levels are converted into a binary submatrix with as many rows as x and as many columns as levels or categories. (Indicator matrix)

Integer Variables are treated as factors

Continuous Variables are converted into binary variables using a cut point that can be the median, the mean or a value provided by the user.

Value

A Binary Data Matrix.

Author(s)

Jose Luis Vicente Villardon

Examples

1
2

villardon/MultBiplotR documentation built on June 5, 2021, 8:55 a.m.