Learn R Programming

cats (version 0.1)

get_cat: Get a random cat image

Description

Grabs a random cat image from http://theoldreader.com/kittens and returns it as an RGB array.

Usage

get_cat(width = 400, height = 400)

Arguments

width
Width in pixels of the requested image
height
Height in pixels of the requested image

Value

An height by width by 3 array containing RGB values between 0 and 1

Examples

Run this code
# Give me RGB
get_cat(10, 10)
# Or make me a picture
plot(1:2, type='n', axes = FALSE)
rasterImage(get_cat(), 1, 1, 2, 2)

Run the code above in your browser using DataLab