cowsay
makes it easy
to print messages, warnings, or character strings with various animals
and other creatures.
Stable version from CRAN
or dev version from GitHub
The animals, and other ascii creatures, are all in a single named character vector that is exported from the package. Thus, you can access each animal yourself, and do whatever you want with it.
As of this writing, there are 49 animals.
The names of the animals:
sort(names(animals))
#> [1] "alligator" "ant" "anxiouscat" "bat" "bat2"
#> [6] "behindcat" "bigcat" "buffalo" "cat" "chicken"
#> [11] "chuck" "clippy" "cow" "daemon" "duck"
#> [16] "duckling" "egret" "endlesshorse" "facecat" "fish"
#> [21] "frog" "ghost" "goldfish" "grumpycat" "hypnotoad"
#> [26] "longcat" "longtailcat" "monkey" "mushroom" "owl"
#> [31] "pig" "poop" "pumpkin" "rabbit" "shark"
#> [36] "shortcat" "signbunny" "smallcat" "snowman" "spider"
#> [41] "squirrel" "squirrel2" "stegosaurus" "stretchycat" "trilobite"
#> [46] "turkey" "whale" "wolf" "yoda"
For example, access the cow
We expose the function say()
in this package, which you
can use to envoke any animal in the package, and make it say whatever
you want. Some examples:
say("why did the chicken cross the road", "chicken")
#>
#> -----
#> why did the chicken cross the road
#> ------
#> \
#> \
#> _
#> _/ }
#> `>' \
#> `| \
#> | /'-. .-.
#> \' ';`--' .'
#> \'. `'-./
#> '.`-..-;`
#> `;-..'
#> _| _|
#> /` /` [nosig]
#>
say("boo!", "ghost")
#>
#> -----
#> boo!
#> ------
#> \
#> \
#> .-.
#> (o o)
#> | O \
#> \ \
#> `~~~' [nosig]
#>
say("nope, don't do that", type = "warning")
#> Warning in say("nope, don't do that", type = "warning"):
#> --------------
#> nope, don't do that
#> --------------
#> \
#> \
#> \
#> |\___/|
#> ==) ^Y^ (==
#> \ ^ /
#> )=*=(
#> / \
#> | |
#> /| | | |\
#> \| | |_|/\
#> jgs //_// ___/
#> \_)
#>
There’s the special time
, that will print out the
time
You can use say()
and give back a string, message, or
warning
Message
say("hello world", by = "cow")
#>
#> -----
#> hello world
#> ------
#> \ ^__^
#> \ (oo)\ ________
#> (__)\ )\ /\
#> ||------w|
#> || ||
Warning
say("hello world", by = "cow", type = "warning")
#> Warning in say("hello world", by = "cow", type = "warning"):
#> -----
#> hello world
#> ------
#> \ ^__^
#> \ (oo)\ ________
#> (__)\ )\ /\
#> ||------w|
#> || ||
String