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, derek@derekogle.com
## Individual values is.odd(1)#> [1] TRUEis.odd(2)#> [1] FALSEis.even(3)#> [1] FALSEis.even(4)#> [1] TRUE#> d odd even #> 1 1 TRUE FALSE #> 2 2 FALSE TRUE #> 3 3 TRUE FALSE #> 4 4 FALSE TRUE #> 5 5 TRUE FALSE #> 6 6 FALSE TRUE #> 7 7 TRUE FALSE #> 8 8 FALSE TRUE