#' Determine the noise of an animal
#'
#' This function works out the appropriate noise
#'
#' @param animal name of animal
#' @return Animal's noise
#' @author matt
#' @examples animal.noise("elephant") # Silence
#' animal.noise("dog") # Woof
#' @export
animal.noise = function(animal)
{
switch(animal,
"dog"="Woofie",
"cat"="Meow",
"cow"="Moo",
"duck"="Quack",
"elephant"="Silence",
"donkey"="Eeeor",
"Who cares"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.