Learn R Programming

HydroCode (version 1.0.3)

is.odd: Number Type

Description

is.odd tests whether a number is odd. is.even returns the opposite

Usage

is.odd(x)

is.even(x)

Value

a vector of type logical

Arguments

x

numeric object to be tested

Examples

Run this code
x <- seq(1, 9, 2)
is.odd(x)
y <- seq(2, 8, 2)
is.even(y)
# NA values
x[1] <- NA
is.odd(x)

Run the code above in your browser using DataLab