Learn R Programming

MultBiplotR (version 23.11.0)

Numeric2Binary: Converts a numeric variable into a binary one

Description

Converts a numeric variable into a binary one using a cut point

Usage

Numeric2Binary(y, name= "MyVar", cut = NULL)

Value

A binary Variable

Arguments

y

Vector containing the numeric values

name

Name of the variable

cut

Cut point to cut the values of the variable. If is NULL the median is used.

Author

Jose Luis Vicente-Villardon

Details

Converts a numeric variable into a binary one using a cut point. If the cut is NULL the median is used.

See Also

Dataframe2BinaryMatrix

Examples

Run this code
y=c(1, 1.2, 3.2, 2.4, 1.7, 2.2, 2.7, 3.1)
Numeric2Binary(y)

Run the code above in your browser using DataLab