Cowsay
cowsay w/ more animals, in R
Install / Use
/learn @sckott/CowsayREADME
cowsay
What is this?
If you are familiar with cowsay on the cli, then you know what this is, but for R. If not, read below. Why? Why not?
History
cowsay was originally written by Tony Monroe, with the first code released in 1999. The version of cowsay you get via homebrew is a fork by Andrew Janke at https://cowsay.diamonds/ (code repo). The code for the original can be found at tnalpgge/rank-amateur-cowsay and the original website can be seen on the Wayback Machine. Both the original and version by Janke are both written in Perl. The cowsay you get with apt on Linux machines is the last version Monroe released in 2016 (v3.0.4 or possibly v3.0.3).
This R package has some additional features the orginal cowsay doesn't have, but also lacks some features the original has. This package doesn't yet support custom eyes and tongue for the cow or any other animals.
Contributors (alphabetical)
- Amanda Dobbyn
- Andreas Brandmaier
- Andy Teucher
- Carson Sievert
- David Schoch
- Franz-Sebastian Krah
- Guangchuang Yu
- Karl Broman
- Kiyoko Gotanda
- Lucy D'Agostino McGowan
- Marion Louveaux
- Noam Ross
- Paolo Sonego
- Philipp Boersch-Supan
- Rich FitzJohn
- Scott Chamberlain
- Thomas Leeper
- Tyler Rinker
That's right, it takes 18 people to make cowsay - it's that hard.
Contributing
See [CONTRIBUTING.md][contrib]
Where to find ASCII animal art
Sources to look in:
- https://asciiart.website/ - again, this person only collects them - no mention of license, permissions, etc.
Permissions
In the ascii art mailing list https://groups.google.com/forum/#!forum/alt.ascii-art they say:
As for posting other people's ASCII art,
after a discussion in news:alt.ascii-art _ ___
the following rules were agreed upon: #_~`--'__ `===-,
1. If an ASCII ART picture has initials `.`. `#.,//
on it, leave them on when posting it ,_\_\ ## #\
2. If an ASCII ART picture doesn't have `__.__ `####\
initials on it, mention that you ~~\ ,###'~
didn't draw it when posting it. \##'
3. If somebody posts a picture without [nosig]
initials and you have an original copy
with initials on, feel free to re-post the original version.
* The re-post ought not to be taken personally, as we all
know that ASCII art often loses proper credits.
Responses to the re-post are not necessary.
One contributor, name of Krogg, suggested the following:
1.) Ultra polite:...ya make yer own ascii and use it.
2.) Very polite:...Ya contact the author and ask if ya
can use it...
3.) polite:...Ya use it but you keep the Credits
in there like they should be.
4.) rude:...Ya use it and strip credits.
5.) Very rude:...Ya use it and claim that it Is
_Your_ very own creation...
So, let's go with this rule: Let's include found (on the web) ascii art in this pkg, include signature if there, and if no signature, put in a [nosig] (see above).
Quick watch start
Asciicast: https://asciinema.org/a/7745
Install
From CRAN
# install.packages("pak")
pak::pak("cowsay")
Dev version
# install.packages("pak")
pak::pak("sckott/cowsay")
library("cowsay")
The animals
sort(animals)
#> [1] "alligator" "ant" "anxiouscat" "bat" "bat2"
#> [6] "beavis" "behindcat" "bigcat" "blowfish" "buffalo"
#> [11] "cat" "chicken" "chuck" "clippy" "cow"
#> [16] "cow_borg" "cow_dead" "cow_greedy" "cow_sleepy" "cow_tired"
#> [21] "cow_wired" "cow_young" "daemon" "dragon" "duck"
#> [26] "duckling" "egret" "endlesshorse" "facecat" "fish"
#> [31] "frog" "ghost" "goldfish" "grumpycat" "hypnotoad"
#> [36] "longcat" "longtailcat" "monkey" "mushroom" "owl"
#> [41] "pig" "poop" "pumpkin" "rabbit" "shark"
#> [46] "shortcat" "signbunny" "smallcat" "snowman" "spider"
#> [51] "squirrel" "squirrel2" "stegosaurus" "stretchycat" "trilobite"
#> [56] "turkey" "whale" "wolf" "yoda"
Say Something
say("time")
#>
#> ____________________________
#> < 2025-10-28 22:36:13.574411 >
#> ----------------------------
#> \
#> \
#>
#> ^__^
#> (oo)\ ________
#> (__)\ )\ /\
#> ||------w|
#> || ||
say("ain't that some shit", "chicken")
#>
#> ______________________
#> < ain't that some shit >
#> ----------------------
#> \
#> \
#> _
#> _/ }
#> `>' \
#> `| \
#> | /'-. .-.
#> \' ';`--' .'
#> \'. `'-./
#> '.`-..-;`
#> `;-..'
#> _| _|
#> /` /` [nosig]
Add some color:
library(crayon)
say("boo!", "ghost", what_color = "cyan", by_color = "saddlebrown")
<p align="left">
<img src="./man/figures/ghost.png" alt="ghost" height="200px">
</p>
say(
"I love hooo you are!",
"owl",
what_color = rgb(0, 1, 1),
by_color = "#FF0000"
)
<p align="left">
<img src="./man/figures/owl.png" alt="owl" height="200px">
</p>
String styles together crayon-style:
say(
what = "rms",
by = "rms",
what_color = yellow$bgMagenta$bold,
by_color = cyan$italic
)
<p align="left">
<img src="./man/figures/rms.png" alt="rms" height="350px">
</p>
This doesn't preclude you from adding extra crayon colors to your what string directly - but the results are not super pretty:
say(
what = paste0("hello ", crayon::yellow("there "), crayon::underline("world")),
by = "trilobite"
)
<p align="left">
<img src="./man/figures/trilobite.png" alt="trilobite" height="250px">
</p>
Vary type of output, default calls message()
say("hell no!")
#>
#> __________
#> < hell no! >
#> ----------
#> \
#> \
#>
#> ^__^
#> (oo)\ ________
#> (__)\ )\ /\
#> ||------w|
#> || ||
say("hell no!", type = "warning")
#> Warning in say("hell no!", type = "warning"):
#> __________
#> < hell no! >
#> ----------
#> \
#> \
#>
#> ^__^
#> (oo)\ ________
#> (__)\ )\ /\
#> ||------w|
#> || ||
say("hell no!", type = "string")
#> [1] "\n __________ \n< hell no! >\n ---------- \n \\\n \\\n\n ^__^ \n (oo)\\ ________ \n (__)\\ )\\ /\\ \n ||------w|\n || ||"
Long cat
From the a Boing Boing tweet on 2014-05-10 "twitter.com/BoingBoing/status/465170473194512384" (post may be gone)
say("it's caturday", "longcat")
#>
#> _______________
#> < it's caturday >
#> ---------------
#> \
#> \
#>
#> .ハ,,ハ
#> ( ゚ω゚)
#> |つ つ
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> | |
#> U " U
#> [BoingBoing]
Grumpy cat
say("NO!", by = "grumpycat")
#>
#> _____
#> < NO! >
#> -----
#> \
#> \
#>
#> ハ _ ハ
#> ಠ X ಠ
say("WOKE UP TODAY, IT WAS TERRIBLE", by = "grumpycat")
#>
#> ________________________________
#> < WOKE UP TODAY, IT WAS TERRIBLE >
#> --------------------------------
#> \
#> \
#>
#> ハ _ ハ
#> ಠ X ಠ
say("I HAD FUN ONCE, IT WAS AWFUL", by = "grumpycat")
#>
#> ______________________________
#> < I HAD FUN ONCE, IT WAS AWFUL >
#> ------------------------------
#> \
#> \
#>
#> ハ _ ハ
#> ಠ X ಠ
Bunny Holding a sign
say(by = "signbunny")
#>
#> ______________
#> < Hello world! >
#> --------------
#> \
#> \
#>
#> (\__/) ||
#> (•ㅅ•) ||
#> / づ
#> [nosig]
Fish
say(by = "fish")
#>
#> ______________
#> < Hello world! >
#> --------------
#> \
#> \
#>
#> ><((((º> ><((((º> ><((((º> ><((((º> ><((((º>
#> Kiyoko Gotanda
R fortunes
library(fortunes)
say("fortune", "cat")
#>
#> _________________________________________________________
#> / I'll go back to lurking in the daily R-Helps and not \
#> | ask any more questions until I've read all the old |
#> | R-help messages. I'm working on December 1998 right now |
#> | and reading forward. Perhaps by next year I'll will |
#> | have read all the old R-help postings and I'll dare ask |
#> | another question then. Earl F. Glynn R-help January |
#> \ 2012 /
#> ------------------------------------
