Learn R Programming

sinx (version 0.0.13)

tanx: TAlked by SiNo Xmen's Pets

Description

TAlked by SiNo Xmen's Pets

Usage

tanx(
  which = NULL,
  sinxs.data = NULL,
  what = "Hello world!",
  by = "random",
  type = "message",
  what_color = "steelblue3",
  by_color = NULL,
  length = 18,
  ...
)

Arguments

which

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

sinxs.data

data frame containing a saying in each row. By default the data from the 'sinx' package are used.

what

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

by

(character) Type of thing, one of cow, chicken, poop, cat, facecat, bigcat, longcat, shortcat, behindcat, longtailcat, anxiouscat, grumpycat, smallcat, ant, pumpkin, ghost, spider, rabbit, pig, snowman, frog, hypnotoad, signbunny, stretchycat, fish, trilobite, shark, buffalo, clippy, mushroom, monkey, egret, 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, or string (returns string). If multiple colors are supplied to what_color or by_color, type cannot be warning. (This is a limitation of the multicolor packcage :/.)

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.

...

Further args passed on to sinx

Details

You can put in any phrase you like, 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 package. Best paired with by = "rms".

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

Run this code
# NOT RUN {
tanx()

for (i in 1:4) tanx(i)

path_f <- system.file("fortunes/fortunes.csv", package = "fortunes")
path_s <- system.file("sinxs/sinxs.csv", package = "sinx")
ftns <- sinx::read.sinxs(c(path_f, path_s), sep = c(";", ","))
sinx::tanx(sinxs.data = ftns)

jinyong <- read.sinxs(lib = "jinyong")
tanx(sinxs.data = jinyong)

libs <- read.sinxs(lib = c("tangshi", "songshi", "chinese", "yangsheng", "english", 
    "jinyong"))
tanx(42, sinxs.data = libs)
# }

Run the code above in your browser using DataLab