R/compute_squares.R

#' Compute squares
#'
#' @param x numeric to compute the square of
#'
#' @return square of x
#' @export
#'
#' @author Pedro Neves
#'
#' @examples compute_square(2)
compute_square <- function(x) {
  if (!is.numeric(x)) {
    stop("Error: x must be numeric")
  }
  out <- x * x
  out
}
Neves-P/newpackage documentation built on May 18, 2019, 1:29 p.m.