R/hello.R

Defines functions hello

Documented in hello

#' @title Say hello
#'
#' @description This function says hello.
#' @param world a logical indicating if we are saying hello
#' to the world. (Default TRUE)
#' @param verbose should the return be printed? (Default FALSE)
#' @return nothing
#' @examples
#' hello(FALSE)
#' @export
hello <- function(world = TRUE, verbose = FALSE) {
  if (!is.logical(world) && !is.logical(verbose)) {
    stop("Parameters must be logical.")
  }
  if (world) {
    ret <- "Hello, world!"
  } else {
    ret <- "Hello!"
  }
  if (verbose) {
    print(ret)
  }
  invisible(ret)
}
Violettttta/bis620 documentation built on Oct. 9, 2022, 10:28 a.m.