Learn R Programming

FSA (version 0.8.32)

oddeven: Determine if a number is odd or even.

Description

Determine if a number is odd or even.

Usage

is.odd(x)

is.even(x)

Arguments

x

A numeric vector.

Value

A logical vector of the same length as x.

Examples

Run this code
# NOT RUN {
## Individual values
is.odd(1)
is.odd(2)
is.even(3)
is.even(4)

## Vector of values
d <- 1:8
data.frame(d,odd=is.odd(d),even=is.even(d))
# }

Run the code above in your browser using DataLab