Learn R Programming

kittyR (version 1.1.0)

kittyR: Cats in R console.

Description

This function displays a picture of a cat and plays a short sound clip containing cat meow. It is possible that once in a while you might get a picture that is in no way feline related. In such cases, just try again.

Currently, the images are collected from the following sources-

  1. https://unsplash.com/s/photos/cat/

  2. https://www.reshot.com/search/cat/

  3. https://unsplash.com/s/photos/kitten/

  4. https://www.reshot.com/search/kitten/

The sound files come from the following CC BY 3.0 source: https://soundbible.com/

Usage

kittyR(url = NULL, meow = TRUE, sound = 3, only_kitten = FALSE, ...)

Arguments

url

URL for the source from which individual image URLs are to be extracted. Default is NULL. If NULL, a randomly drawn image from the default collection will be shown.

meow

Logical that decides whether to play a meow sound along with the picture of a cat.

sound

A character string or a number specifying what sound to be played by either specifying one of the built in sounds, specifying the path to a .wav file or specifying an URL. There are currently 6 meows included. The default is 3.

only_kitten

Logical that decides whether only kitten pics should be selected (default: FALSE).

...

Additional arguments (currently ignored).

Value

A photo of a cat is downloaded and displayed in the plot window.

Examples

Run this code
# NOT RUN {
library(kittyR)

# relying on default collection
set.seed(122)
kittyR(meow = FALSE)

# in case you want only pics of kittens
set.seed(111)
kittyR(meow = FALSE, only_kitten = TRUE)

# provide a custom URL
set.seed(300)
kittyR(
  url = "https://unsplash.com/s/photos/cat/",
  meow = FALSE
)
# }

Run the code above in your browser using DataLab