binarize: Binarization

View source: R/powerPsy.R

binarizeR Documentation

Binarization

Description

Binarizes vectors or columns based on a cut-off into 0 and 1.

Usage

binarize(data, cut_off)

Arguments

data

A dataset containing only the columns which are to be binarized

cut_off

A cutoff used to binarize. Values <= cut-off will be binarized to 0, Values > cut-off will be binarized to 1.

Value

A dataframe containing the original columns named VN (with N: 1 -> number of columns) and binarized columns named v_binN (with N: 1 -> number of columns).

Examples

## Not run: 
data_binarized <- binarize(data_test, cut_off = 2)
data_binarized

## End(Not run)

orduek/PsychPower documentation built on Oct. 25, 2023, 7:36 a.m.