to_boolean: To Boolean

View source: R/boolean.R

to_booleanR Documentation

To Boolean

Description

Convert a vector to boolean/logical

Usage

to_boolean(x, ...)

## S3 method for class 'logical'
to_boolean(x, ...)

## S3 method for class 'numeric'
to_boolean(x, true = 1L, false = 0L, ...)

## S3 method for class 'character'
to_boolean(x, true = NULL, false = NULL, ...)

## S3 method for class 'factor'
to_boolean(x, true = NULL, false = NULL, ...)

Arguments

x

A vector of values

...

Additional arguments passed to methods

true

A vector of values to convert to TRUE

false

A vector of values to convert to FALSE

Value

A logical vector of equal length as x


jmbarbone/jordan documentation built on April 1, 2024, 7:46 p.m.