imguR (version 1.0.3)

imgur: Initiate an Imgur-enabled Graphics Device

Description

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

Usage

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.

Value

“imgur_device” to be passed to imgur_off.

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.

See Also

imgur_off upload_image

Examples

Run this code
## Not run: 
# i <- imgur('png')
# hist(rnorm(20))
# imgur_off(i)
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace