Learn R Programming

tester (version 0.2.0)

is_natural: Is natural

Description

Test if is a natural number

Usage

is_natural(x)

Arguments

x

an R object

Details

Zero is not included in the set of natural numbers

See Also

is_negative

Examples

Run this code
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)

Run the code above in your browser using DataLab