is_natural: Is natural

Description Usage Arguments Details See Also Examples

Description

Test if is a natural number

Usage

1

Arguments

x

an R object

Details

Zero is not included in the set of natural numbers

See Also

is_negative

Examples

1
2
3
4
5
6
7
is_natural(1)
is_natural(0)
is_natural(seq(-2, 3))
is_natural(iris$Species)

M = matrix(seq(-3, 2), 2, 3)
is_natural(M)

Example output

[1] TRUE
[1] FALSE
[1] FALSE FALSE FALSE  TRUE  TRUE  TRUE
[1] FALSE
      [,1]  [,2] [,3]
[1,] FALSE FALSE TRUE
[2,] FALSE FALSE TRUE

tester documentation built on May 2, 2019, 1:09 p.m.