R/oddeven.R

Defines functions odd even is.odd is.even

Documented in even is.even is.odd odd

is.even <- function( x ) return( ifelse(  x %% 2 == 0, TRUE, FALSE ) )
is.odd <- function( x ) return( ifelse( x %% 2 == 1, TRUE, FALSE ) )

even <- function( x ) return( x[ is.even( x ) ] )
odd <- function( x ) return( x[ is.odd( x ) ] )

Try the distillery package in your browser

Any scripts or data that you put into this service are public.

distillery documentation built on May 19, 2021, 9:08 a.m.