is.odd: Number Type

Description Usage Arguments Value Note Examples

View source: R/logical.R

Description

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

Usage

1
2
3

Arguments

x

numeric object to be tested

Value

a vector of type logical

Note

if x contains NA the function returns NA

Examples

1
2
3
4
5
6
7
x <- seq(1, 9, 2)
is.odd(x)
y <- seq(2, 8, 2)
is.even(y)
# NA values
x[1] <- NA
is.odd(x)

HydroCode documentation built on Sept. 1, 2020, 1:07 a.m.

Related to is.odd in HydroCode...