Learn R Programming

tester (version 0.2.0)

is_even: Is even

Description

Test if an object is an even number
is_not_even tests the opposite condition

Usage

is_even(x)

Arguments

x

an R object

See Also

is_odd

Examples

Run this code
is_even(2)
is_even(1)
is_even(seq(-5, 5))

is_even(iris$Species)
is_even(iris)
is_even(list(1, 0, -1, iris))

set.seed(999)
M = matrix(1:12, 4, 3)
is_even(M)

Run the code above in your browser using DataLab