R/multipleof.R

#' Multiple Logic
#'
#' Logical response to whether x is an even multiple of y.
#' @param x Numeric, single.
#' @param y Numeric, single
#' @export
#' @return T/F

multipleof <- function(x, y){
  if (!is.numeric(x)) stop("'x' must be numeric.")
  if (length(x) != 1) stop("'x' must be of length == 1.")
  x1 <- x[x %% y == 0]
  if (length(x1) == 1){
    return(T)
  }else{
    return(F)
  }
}
ssaxe-usgs/saxy documentation built on May 31, 2019, 11:45 p.m.