R/area_square.R

#' Calculate the area of a square
#'
#' @param s length of a side.
#' @return The area of the square
#' @examples
#' area_square(2)
#' area_square(10)
#' @export
area_square <- function(s) {
  if (s > 0) {
     s**2
  }
  else {
    "Can't have negative values"
  }
}
katiesocolow/Week_2_Project_Package documentation built on May 12, 2019, 10:33 p.m.