booleanize: Reduce the numeric values of a data.frame to boolean values

Description Usage Arguments Value Examples

View source: R/data_preparation_functions.R

Description

booleanize returns an other version of the input data.frame with simple, definable present-absent information instead of numeric values. Absent means zero.

Usage

1
booleanize(x, present = TRUE, absent = FALSE)

Arguments

x

matrix or data.frame. Table with only numeric values.

present

any atomic type. Replacement values for cells with numeric value >0. default: TRUE

absent

any atomic type. Replacement values for cells with numeric value 0. default: FALSE

Value

A matrix or data.frame with present-absent values.

Examples

1
2
3
4
testmatrix <- data.frame(c1 = c(0,2,0,8), c2 = c(5,6,7,0), c3 = c(5,6,7,0))

booleanize(testmatrix)
booleanize(x = testmatrix, present = "cake", absent = "no cake")

ISAAKiel/quantAAR documentation built on July 12, 2020, 4:16 p.m.