inst/testpkg/R/add.R

#' Add two numbers together
#'
#' @param x A number
#' @param y Another number
#' @param na.rm Drop NAs?
#' @examples
#' add(1, 2)
#' @export
add <- function(x, y, na.rm = FALSE) {
  if (na.rm || !any_nas(x,y)) {
    return(x + y)
  } else {
    return(NA)
  }
}
thisisnic/docreview documentation built on Feb. 20, 2024, 1:53 p.m.