R/hello.R

Defines functions hello

Documented in hello

#' Hello World!
#'
#'Print hello greeting from me
#'
#' @param name character string, name to be greeted
#'
#' @return prints hello greeting to console from me
#' @export
#'
#' @examples
#' hello()
#' hello("Chobe Chamabondo")
hello <- function(name = NULL) {
  # create greeting
  if(is.null(name)){name <- "World"}
  greeting <- paste("Hello", name, "! From Helen xx")
  # randomly sample an animal
  animal_names <- names(cowsay::animals)
  i <- sample(1:length(animal_names), 1)
  cowsay::say(greeting, animal_names[i])
}
HelenMylne/mypackage documentation built on Dec. 17, 2021, 10:32 p.m.