R/welcome.R

Defines functions welcome

Documented in welcome

#' An enhanced welcome
#'
#' It prints a welcome message, saying number of times.
#'
#' @param n The number of times (>1 integer) to welcome the user.
#' @return Prints a welcome message to the console.
#' @examples
#' welcome(3)
#'
#' @export

welcome <- function(n) {
  if (missing(n)) {
    stop("Argument 'n' is missing.")
  }
  if (!is.numeric(n) || n <= 1 || n != floor(n)) {
    stop("Argument 'n' must be an integer > 1.")
  }
  cat("Welcome to gaawr2", n, "times!\n")
}

Try the gaawr2 package in your browser

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

gaawr2 documentation built on April 4, 2025, 2:25 a.m.