inst/testpkg/R/deduct.R

#' Deduct one number from another
#'
#' @param x A number
#' @param y Another number
#' @param na.rm Drop NAs?
#' @export
deduct <- function(x, y, na.rm = FALSE) {
  if (!na.rm || !any_nas(x,y)) {
    return(x - y)
  } else {
    return(NA)
  }
}

Try the docreview package in your browser

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

docreview documentation built on Aug. 17, 2021, 9:06 a.m.