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)
  }
}

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.