R/animal_fetch.R

Defines functions animal_fetch

Documented in animal_fetch

#' Fetch an animal
#' @export
#' @param by (character) which animal to get
#' @return single string
#' @examples
#' animal_fetch("longtailcat")
#' cat(animal_fetch("longtailcat"))
#' animal_fetch("poop")
#' cat(animal_fetch("poop"))
animal_fetch <- function(by) {
  x <- readLines(system.file(sprintf("cows/%s.cow", by), package = "cowsay"))
  paste(x, collapse = "\n")
}

Try the cowsay package in your browser

Any scripts or data that you put into this service are public.

cowsay documentation built on Nov. 5, 2025, 5:30 p.m.