ggpostcard_example_rstereogram: An example postcard with art from the rstereogram package

View source: R/ggpostcard_example_rstereogram.R

ggpostcard_example_rstereogramR Documentation

An example postcard with art from the rstereogram package

Description

This example makes a postcard where if you cross your eyes you see a secret image! It uses the package rstereogram by Ryan Timpe.

Usage

ggpostcard_example_rstereogram(
  image_filename = NULL,
  colors = c("#00436b", "#ffed89"),
  alpha_only = FALSE,
  ...
)

Arguments

image_filename

(optional) The path of the PNG file to be the image. If NULL defaults to the R logo

colors

(optional) vector of visually distinct colors to make the image

alpha_only

(optional) If the alpha channel of the png file

Details

Depending on the size of the image preview the image may be distorted. Try zooming in and out of the picture on your monitor to see the effect.

The default image is the R logo, however you can pass your own PNG file. Suggestions for your own file:

  • It should have the aspect ratio 5.875in x 3.875in

  • It should be grayscale

  • It should be a small file (height around 500 pixels)

Value

a ggplot2 plot to pass to ggpostcard

See Also

Other ggpostcard_examples: ggpostcard_example_contouR(), ggpostcard_example_sunrise()

Examples

library(ggirl)
return_address <- address(name = "Jacqueline Nolis", address_line_1 = "111 North St",
                          city = "Seattle", state = "WA",
                          postal_code = "11111", country = "US")
contact_email <- "fakeemailforreal@gmail.com"
send_addresses <- address(name = "Fake Personname", address_line_1 = "250 North Ave",
                          city = "Boston", state = "MA",
                          postal_code = "22222", country = "US")
messages <- "Look at this cool plot I found!"
plot <- ggpostcard_example_rstereogram()
ggpostcard(plot = plot, contact_email = contact_email, return_address = return_address,
  send_addresses = send_addresses, messages = messages)

jnolis/ggirl documentation built on July 1, 2023, 4:51 p.m.