is.odd | R Documentation |
Determine if a number is odd or even.
is.odd(x)
is.even(x)
x |
A numeric vector. |
A logical vector of the same length as x.
Derek H. Ogle, DerekOgle51@gmail.com
## 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.