Skip to contents

Sling messages and warnings with flair

Usage

say(
  what = "Hello world!",
  by = "cat",
  type = NULL,
  what_color = NULL,
  by_color = NULL,
  length = 18,
  fortune = NULL,
  ...
)

Arguments

what

(character) What do you want to say? See Details.

by

(character) Type of thing, one of cow, chicken, chuck, clippy, poop, bigcat, ant, pumpkin, ghost, spider, rabbit, pig, snowman, frog, hypnotoad, shortcat, longcat, fish, signbunny, facecat, behindcat, stretchycat, anxiouscat, longtailcat, cat, trilobite, shark, buffalo, grumpycat, smallcat, yoda, mushroom, endlesshorse, bat, bat2, turkey, monkey, daemon, egret, duckling, duck, owl, squirrel, squirrel2, goldfish, alligator, stegosaurus, whale, wolf, or rms for Richard Stallman. Alternatively, use "random" to have your message spoken by a random character. We use match.arg() internally, so you can use unique parts of words that don't conflict with others, like "g" for "ghost" because there's no other animal that starts with "g".

type

(character) One of message (default), warning, print (default in non-interactive mode), or string (returns string). If run in non-interactive mode default type is print, so that output goes to stdout rather than stderr, where messages and warnings go.

what_color

(character or crayon function) One or more crayon-suported text color(s) or crayon style function to color what. You might try colors() or ?rgb for ideas. Use "rainbow" for c("red", "orange", "yellow", "green", "blue", "purple").

by_color

(character or crayon function) One or more crayon-suported text color(s) or crayon style function to color who. Use "rainbow" for c("red", "orange", "yellow", "green", "blue", "purple")

length

(integer) Length of longcat. Ignored if other animals used.

fortune

An integer specifying the row number of fortunes.data. Alternatively which can be a character and grep is used to try to find a suitable row.

...

Further args passed on to fortunes::fortune()

what

You can put in any phrase you like to the what parameter, OR you can type in one of a few special phrases that do particular things. They are:

  • "catfact": A random cat fact from https://catfact.ninja

  • "fortune": A random quote from an R coder, from fortunes library

  • "time": Print the current time

  • "rms": Prints a random 'fact' about Richard Stallman from the rmsfact::rmsfact() package. Best paired with by = "rms".

by

Note that if you choose by='hypnotoad' the quote is forced to be, as you could imagine, 'All Glory to the HYPNO TOAD!'. For reference see http://knowyourmeme.com/memes/hypnotoad

signbunny: It's not for sure known who invented signbunny, but this article http://www.vox.com/2014/9/18/6331753/sign-bunny-meme-explained thinks they found the first use in this tweet: https://twitter.com/wei_bluebear/status/329101645780770817

trilobite: from http://www.retrojunkie.com/asciiart/animals/dinos.htm (site down though)

Note to Windows users: there are some animals (shortcat, longcat, fish, signbunny, stretchycat, anxiouscat, longtailcat, grumpycat, mushroom) that are not available because they use non-ASCII characters that don't display properly in R on Windows.

Examples

say()
#> 
#>  -------------- 
#> Hello world! 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say("what")
#> 
#>  -------------- 
#> what 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say('time')
#> 
#>  -------------- 
#> 2024-10-31 18:28:41.302794 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   

say("who you callin chicken", "chicken")
#> 
#>  ----- 
#> who you callin chicken 
#>  ------ 
#>     \   
#>      \
#>          _
#>        _/ }
#>       `>' \
#>       `|   \
#>        |   /'-.     .-.
#>         \'     ';`--' .'
#>          \'.    `'-./
#>           '.`-..-;`
#>             `;-..'
#>             _| _|
#>             /` /` [nosig]
#>   
say("ain't that some shit", "poop")
#> 
#>  ----- 
#> ain't that some shit 
#>  ------ 
#>     \   
#>      \
#>      (   )
#>   (   ) (
#>    ) _   )
#>     ( \_
#>   _(_\ \)__
#>  (____\ ___)) [nosig]
say("icanhazpdf?", "cat")
#> 
#>  -------------- 
#> icanhazpdf? 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say("boo!", "pumpkin")
#> 
#>  ----- 
#> boo! 
#>  ------ 
#>     \   
#>      \
#>                   ___
#>                ___)__|_
#>           .-*'          '*-,
#>          /      /|   |\     \
#>         ;      /_|   |_\     ;
#>         ;   |\           /|  ;
#>         ;   | ''--...--'' |  ;
#>          \  ''---.....--''  /
#>           ''*-.,_______,.-*'  [nosig]
#>   
say("hot diggity", "frog")
#> 
#>  ----- 
#> hot diggity 
#>  ------ 
#>     \   
#>      \
#>         (.)_(.)
#>      _ (   _   ) _
#>     / \/`-----'\/ \
#>   __\ ( (     ) ) /__
#>   )   /\ \._./ /\   (
#>    )_/ /|\   /|\ \_(  [nosig]
#>   
say("fortune", "spider")
#> 
#>  ----- 
#> Warning: Although abusing R was not proved to be addictive, it should be noted that it often leads to harder stuff.
#>  Ivan Mizera (self-confessed abuseR)
#>  useR! 2006, Vienna
#>  June 2006 
#>  ------ 
#>     \   
#>      \
#>               |
#>               |
#>               |
#>              __
#>           | /  \ |
#>          \_\\  //_/
#>           .'/()\'.
#>            \\  //  [nosig]
#>   
say("fortune", "facecat")
#> 
#>  -------------- 
#> 1st mail: One of the reasons that SAM is popular, is that it is popular (i.e. since everyone has heard of it, it makes reviewers happy). So, it would be nice to be able to point to publications in good journals so that reviewers will be comfortable. (I personally, am quite comfortable with SAM).
#> 2nd mail: Oops, must have been a Freudian slip. Actually, I am not perfectly comfortable with SAM. But I am quite comfortable with limma.
#>  Naomi Altman
#>  answering the question whether anyone had published data using limma for microarray analysis
#>  bioconductor
#>  June 2004 
#>  --------------
#>     \
#>       \
#>          /\ /\
#>          (O o)
#>         =(:^:)=
#>            U      [nosig]
#>   
say("fortune", "behindcat")
#> 
#>  -------------- 
#> The existence of a method is not a sufficient reason to use that method.
#>  Jari Oksanen
#>  about relative advantages of several multivariate analysis methods
#>  R-SIG-Ecology
#>  November 2013 
#>  --------------
#>       \
#>         \
#>           \
#>             |\___/|
#>             )     (
#>            =\     /=
#>              )===(
#>             /     \
#>             |     |
#>            /       \
#>            \       /
#>       jgs   \__  _/
#>               ( (
#>                ) )
#>               (_(
#>   
say("fortune", "smallcat")
#> 
#>  -------------- 
#> Seldom are prizes, credit, and gratitude given, else Brian would be drowning in them.
#>  Anthony Rossini
#>  about the merits of implementing software
#>  R-help
#>  May 2004 
#>  --------------
#>     \
#>      \
#>       \
#>          /\_/\
#>         ( o.o )
#>          > ^ <      [nosig]
#> 
say("fortune", "monkey")
#> 
#>  ------------- 
#> 3-D bar plots are an abomination. Just because Excel can do them doesn't mean you should.
#> (Dismount pulpit).
#>  Berton Gunter
#>  R-help
#>  October 2007 
#>  -------------- 
#>               \   
#>                \  
#>                 \
#> 
#>                   .="=.
#>                 _/.-.-.\_     _
#>                ( ( o o ) )    ))
#>                 |/  "  \|    //
#>                  \'---'/    //
#>            jgs   /`"""`\\  ((
#>                 / /_,_\ \\  \\
#>                 \_\_'__/  \  ))
#>                 /`  /`~\   |//
#>                /   /    \  /
#>           ,--`,--'\/\    /
#>           '-- "--'  '--'
say("fortune", "egret")
#> 
#>  ----- 
#> If anything, there should be a Law: Thou Shalt Not Even Think Of Producing A Graph That Looks Like Anything From A Spreadsheet.
#>  Ted Harding
#>  in a discussion about producing graphics
#>  R-help
#>  August 2007 
#>  ------ 
#>     \   
#>      \  
#>       \
#>        \   _,
#>       -==<' `
#>           ) /
#>          / (_.
#>         |  ,-,`\
#>          \\   \ \
#>           `\,  \ \
#>            ||\  \`|,
#>  jgs      _|| `=`-'
#>          ~~`~`
say("rms", "rms")
#> 
#> 
#>  ----- 
#> Richard Stallman can touch MC Hammer. 
#>  ------ 
#>     \   
#>      \
#>                     @@@@@@ @
#>                   @@@@     @@
#>                  @@@@ =   =  @@ 
#>                 @@@ @ _   _   @@ 
#>                  @@@ @(0)|(0)  @@ 
#>                 @@@@   ~ | ~   @@
#>                 @@@ @  (o1o)    @@
#>                @@@    #######    @
#>                @@@   ##{+++}##   @@
#>               @@@@@ ## ##### ## @@@@
#>               @@@@@#############@@@@
#>              @@@@@@@###########@@@@@@
#>             @@@@@@@#############@@@@@
#>             @@@@@@@### ## ### ###@@@@
#>              @ @  @              @  @
#>                @                    @

# Vary type of output, default calls message()
say("hell no!")
#> 
#>  -------------- 
#> hell no! 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say("hell no!", type="warning")
#> Warning: 
#>  -------------- 
#> hell no! 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say("hell no!", type="string")
#> [1] "\n -------------- \nhell no! \n --------------\n    \\\n      \\\n        \\\n            |\\___/|\n          ==) ^Y^ (==\n            \\  ^  /\n             )=*=(\n            /     \\\n            |     |\n           /| | | |\\\n           \\| | |_|/\\\n      jgs  //_// ___/\n               \\_)\n  "

# Using fortunes
say(what="fortune")
#> 
#>  -------------- 
#> [Listing original copyright holders in R packages is] especially useful if there are areas of doubt and uncertainty (eg code published on ftp sites before people worried about licenses), since it at least gives you rigidly defined areas of doubt and uncertainty.[5]
#> [5] Adams D, (1978) Hitchhiker's Guide. BBC Radio.
#>  Thomas Lumley
#>  in a discussion about copyright vs. licenses
#>  R-devel
#>  January 2010 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
## you don't have to pass anything to the `what` parameter if `fortune` is
## not null
say(fortune=10)
#> 
#>  -------------- 
#> Overall, SAS is about 11 years behind R and S-Plus in statistical capabilities (last year it was about 10 years behind) in my estimation.
#>  Frank Harrell (SAS User, 1969-1991)
#>  R-help
#>  September 2003 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say(fortune=100)
#> 
#>  -------------- 
#> I'm not sure I'd trust any computer recommendation from 1976, no matter how famous the authors are.
#>  Peter Dalgaard
#>  after Samuel Edward Kemp cited a recommendation about nonlinear least squares computer programs from 'Box-Jenkins, 1976'
#>  R-help
#>  January 2005 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say(fortune='whatever')
#> 
#>  -------------- 
#> Justin: Is there a function that just does whatever I'm thinking (aka whatever my homework question is...)?
#> Joshua Ulrich: That's the magic_pony function.
#>  Justin and Joshua Ulrich
#>  stackoverflow.com
#>  June 2013 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say(fortune=7)
#> 
#>  -------------- 
#> What we have is nice, but we need something very different.
#>  Robert Gentleman
#>  Statistical Computing 2003, Reisensburg
#>  June 2003 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   
say(fortune=45)
#> 
#>  -------------- 
#> It seems to me against the spirit of Open Source software to attempt to monitor distribution. We could ask R to 'call home' on first use (in the way e.g. pine does) but I suspect many users would find that objectionable.
#>  Brian D. Ripley
#>  in a discussion about trying to estimate the number of R users
#>  R-help
#>  April 2004 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#>   

# Using catfacts
# say("catfact", "cat")

# The hypnotoad
say(by="hypnotoad")
#> 
#>  ----- 
#> All Glory to the HYPNO TOAD! 
#>  ------
#>     \          ,'``.._   ,'``.
#>      \        :,--._:)\,:,._,.:
#>       \       :`--,''   :`...';\
#>                `,'       `---'  `.
#>                /                 :
#>               /                   \
#>             ,'                     :\.___,-.
#>            `...,---'``````-..._    |:       \
#>              (                 )   ;:    )   \  _,-.
#>               `.              (   //          `'    \
#>                :               `.//  )      )     , ;
#>              ,-|`.            _,'/       )    ) ,' ,'
#>             (  :`.`-..____..=:.-':     .     _,' ,'
#>              `,'\ ``--....-)='    `._,  \  ,') _ '``._
#>           _.-/ _ `.       (_)      /     )' ; / \ \`-.'
#>          `--(   `-:`.     `' ___..'  _,-'   |/   `.)
#>              `-. `.`.``-----``--,  .'
#>                |/`.\`'        ,','); SSt
#>                    `         (/  (/
#>   

# Trilobite
say(by='trilobite')
#> 
#>  -------------- 
#> Hello world! 
#>  --------------
#>     \
#>       \
#>         \
#>           _____
#>        .'` ,-. `'.
#>       /   ([ ])   \
#>      /.-""`(`)`""-.\
#>       <'```(.)```'>
#>       <'```(.)```'>
#>        <'``(.)``'>
#>    sk   <``\_/``>
#>          `'---'`
#>   

# Shark
say('Q: What do you call a solitary shark\nA: A lone shark', by='shark')
#> 
#>  -------------- 
#> Q: What do you call a solitary shark
#> A: A lone shark 
#>  --------------
#>     \
#>       \
#>         \
#>               /""-._
#>               .       '-,
#>                :          '',
#>                 ;      *     '.
#>                  ' *         () '.
#>                    \               \
#>                     \      _.---.._ '.
#>                     :  .' _.--''-''  \ ,'
#>         .._           '/.'             . ;
#>         ; `-.          ,                \'
#>          ;   `,         ;              ._\
#>           ;    \     _,-'                ''--._
#>           :    \_,-'                          '-._
#>           \ ,-'                       .          '-._
#>           .'         __.-'';            \...,__       '.
#>         .'      _,-'        \              \   ''--.,__  '\
#>         /    _,--' ;         \              ;           \^.}
#>         ;_,-' )     \  )\      )            ;
#>              /       \/  \_.,-'             ;
#>             /                              ;
#>          ,-'  _,-'''-.    ,-.,            ;      PFA
#>       ,-' _.-'        \  /    |/'-._...--'
#>      :--``             )/
#>   '
#>   

# Buffalo
say('Q: What do you call a single buffalo?\nA: A buffalonely', by='buffalo')
#> 
#>  -------------- 
#> Q: What do you call a single buffalo?
#> A: A buffalonely 
#>  --------------
#>     \
#>       \
#>         \
#>                    _.-````'-,_
#>          _,.,_ ,-'`           `'-.,_
#>        /)     (                   '``-.
#>       ((      ) )                      `\
#>         \)    (_/                        )\
#>         |       /)           '    ,'    / \
#>         `\    ^'            '     (    /  ))
#>           |      _/\ ,     /    ,,`\   (  "`
#>           \Y,   |   \  \  | ````| / \_ \
#>             `)_/      \  \  )    ( >  ( >
#>                        \( \(     |/   |/
#>           mic & dwb  /_(/_(    /_(  /_(
#>     

# Clippy
say(fortune=59, by="clippy")
#> 
#> 
#>  ----- 
#> Let's not kid ourselves: the most widely used piece of software for statistics is Excel.
#>  Brian D. Ripley
#>  'Statistical Methods Need Software: A View of Statistical Computing'
#>  Opening lecture RSS 2002, Plymouth
#>  September 2002 
#>  ------ 
#>     \   
#>      \   __
#>    / \
#>    | |
#>    @ @
#>   || ||
#>   || ||
#>   |\_/|
#>   \___/ GB