is_truthy: Is an object TRUTHY?

Description Usage Arguments Examples

Description

Is an object TRUTHY?

Usage

1
is_truthy(object)

Arguments

object

The object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Non-zero numbers are truthy
is_truthy(1)

## So are non-empty vectors that are not the zero scalar
is_truthy(c(1))

## Matrices are truthy, even if they are empty,
## because they are a class
is_truthy(matrix(nrow=0, ncol=0))

## But empty vectors are falsy
is_truthy(numeric())

gaborcsardi/falsy documentation built on May 16, 2019, 4:09 p.m.