phone: Export a phone-sized image

Description Usage Arguments Details Examples

Description

Saves a plot object as an image file that meets the dimension requirements of the "mobile devices and skins" product on society6.com (1300 pixels in width, 2000 pixels in height)

Usage

1
phone(filename, plot, filetype = c("jpeg", "png"), dpi = 300)

Arguments

filename

the filename including the extension

plot

the plot object you want to export in the phone size

Details

Note: current options are jpg or png, and this function has NOT been tested on Windows.

Examples

1
2
3
4
5
6
7
# Base R example
p <- plot(iris$Sepal.Length, y = iris$Petal.Length, type = "p", col = iris$Species)
phone(filename = "iris_baseR.jpeg", plot = p, filetype = "jpeg")

## ggplot2 example
p <- ggplot(iris, aes(Sepal.Length, Petal.Length)) + geom_point(aes(color = Species))
phone(filename = "iris_ggplot.png", plot = p, filetype ="png")

Myfanwy/sizer documentation built on May 7, 2019, 5:15 p.m.