#' Hello World Function
#'
#' @param name
#'
#' @return a character vector of length 1
#' @export
#'
#' @examples
#' hello_world_function(name='Trevor')
hello_world_function <- function(name=NULL){
if(is.null(name)){
return("Hello World")
}else if(length(name)>1){
stop("The name must only be of length 1.")
}else if(is.na(name)){
stop("The name is NA. Need to know who to say hello to.")
}else if(!is.character(name)){
stop("The name must be a character")
}else{
return(paste("Hello", name))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.