R/hello.name.R

#' Say hello to anybody
#'
#' This function returns the string "Hello, *name*!" where name is the input of
#' type character that the user needs to input.
#'
#' @param name A character specifying who you want to greet.
#'
#' @return Character.
#'
#' @note An error is thrown if the input name is not a character.
#'
#' @examples
#' hello.name("Ann")
#' x <- hello.name("Christian")
#' x
#'
#' @export
hello.name <- function(name){
  if(class(name)!="character")stop("Only character objects are accepted as input.")
  paste0("Hello, ", name, "!")
}
MW89/testpckg1337 documentation built on May 28, 2019, 1:46 p.m.