R/is.odd_is.even.R

Defines functions is.even is.odd

Documented in is.even is.odd

### Basically what Marc Schwartz suggested at Thu Jul 1 19:10:28 CEST 2010
### on the R-help mailing list, see https://stat.ethz.ch/pipermail/r-help/2010-July/244299.html

#' Checking whether numbers are odd or even
#'
#' @param vector The vector to process
#'
#' @return A logical vector.
#' @rdname oddOrEven
#'
#' @examples is.odd(4);
#  is.even(4);
#' @export
is.odd <- function(vector) {
  return((vector %% 2) != 0);
}

#'@rdname oddOrEven
#'@export
is.even <- function(vector) {
  return((vector %% 2) == 0);
}

Try the yum package in your browser

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

yum documentation built on July 17, 2021, 1:07 a.m.