R/MyCalc.R

Defines functions MyCalc

MyCalc <- function(x, y){

  assert_that(is_scalar_integer(x),
              msg = "Argument 'x' must be in integer scalar format")

  # Test the Value
  if (x %% 2) {
    val <- x + y
  } else {
    val <- x * y
  }

  # Return Value
  return(val)
}
MatthewL48/MattsTestProject documentation built on May 27, 2019, 7:42 a.m.