imguR: Initiate an Imgur-enabled Graphics Device

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/imguR.R

Description

Open a specified graphics device function an configure it to upload to Imgur

Usage

1
2
imgur(device = png, file = NULL, title = NULL, description = NULL, 
      album = NULL, name = NULL, key = NULL, token = NULL, ...)

Arguments

device

A graphics device function. Default is png.

file

Name of the file to be uploaded to imgur.com

title

Optionally, an image title.

description

Optionally, an image description.

album

Optionally, an Imgur album ID.

name

Optionally, a file name, otherwise the file filename is used.

key

An API key. If NULL, the default imguR package API key is used.

token

Optionally, an OAuth2.0 token (returned by imgur_login. If NULL, the API key used instead.

...

Other arguments passed to the specified device function.

Details

This package is a wrapper for the pdf function. A temporary file is created by pdf, acting as normal graphical device. After plotting, when dev.off is called, the file is closed, uploaded to imguR and a URL of the files location is returned. In the case of multipaged pdfs being uploaded, imguR automatically concatenates them into a single image.

Value

An object of class “imgur_device” to be passed to imgur_off.

Author(s)

Thomas J. Leeper, based on code by Aaron Statham.

See Also

imgur_off upload_image

Examples

1
2
3
4
5
6
## Not run: 
i <- imgur('png')
hist(rnorm(20))
imgur_off(i)

## End(Not run)

imguR documentation built on May 2, 2019, 4:02 p.m.