-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbooleanize.Rd
32 lines (28 loc) · 964 Bytes
/
booleanize.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_preparation_functions.R
\name{booleanize}
\alias{booleanize}
\title{Reduce the numeric values of a data.frame to boolean values}
\usage{
booleanize(x, present = TRUE, absent = FALSE)
}
\arguments{
\item{x}{matrix or data.frame. Table with only numeric values.}
\item{present}{any atomic type. Replacement values for cells with numeric value >0.
default: TRUE}
\item{absent}{any atomic type. Replacement values for cells with numeric value 0.
default: FALSE}
}
\value{
A matrix or data.frame with present-absent values.
}
\description{
\code{booleanize} returns an other version of the input data.frame with
simple, definable present-absent information instead of numeric values.
Absent means zero.
}
\examples{
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")
}