Learn R Programming

jwutil (version 1.2.3)

logical_to_binary: Convert logical columns of data frame to 0s and 1s

Description

Encode TRUE as 1, and FALSE as 0 (integers)

Usage

logical_to_binary(x)

logicalToBinary(x)

Arguments

x

data frame which may contain logical fields

Value

data frame without logical fields

Examples

Run this code
# NOT RUN {
d <- data.frame(
  a = c(TRUE, FALSE, TRUE),
  b = c(FALSE, TRUE, FALSE),
  c = c(-1, 0, 1),
  d = c("not", "logical", "values")
)
logical_to_binary(d)
# }

Run the code above in your browser using DataLab