binarize: Binarizes a dataset

View source: R/defaultFunctions.R

binarizeR Documentation

Binarizes a dataset

Description

This function will transform data into binary data (0,1). If the data is already binary, this function does nothing.

Usage

binarize(x, split = "median", na.rm = TRUE, removeNArows = TRUE, verbose = TRUE)

Arguments

x

A data frame or matrix

split

Either a function to split on (as character or as function) or a vector. e.g., split = "mean" will split every variable on the mean of that variable, split=2 will make every value above 2 a 1 and every value below 2 a 0 and a vector of the same length as each variable in the dataset will use those elements to split.

na.rm

The na.rm argument used in the split function.

removeNArows

Logical, should rows with NA be removed?

verbose

Output progress to the console?

Value

A binarized data frame

Author(s)

Sacha Epskamp <mail@sachaepskamp.com>


bootnet documentation built on May 29, 2024, 8:38 a.m.