imguR (version 0.1.5)

dev.off: Close a plotting device and upload to imguR

Description

This function closes the specified plot (by default the current device) and if it is an imguR device, uploads the plots for web hosting

Usage

dev.off(which = dev.cur(), justLink = TRUE)

Arguments

which
An integer specifying a device number
justLink
A boolean indicating whether to return only a link.

Value

  • If justLink is TRUE, then a character vector of length one is returned containing the URL of where the plot is hosted. If justLink is FALSE, a list parsed from the imguR JSON response after uploading the plot - importantly this includes the link which when visited will delete the plot from imguR.

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.

This function overloads the grDevices::dev.off() function, inspects whether the device chosen to be closed in an imguR device, and if so handles closing and uploading of this device, otherwise passes the which argument to be handled by grDevices::dev.off().

References

http://www.imgur.com http://github.com/astatham/imgur-R-Package

See Also

imguR imguRupload

Examples

Run this code
imguR()
plot(x=1:10, y=-1:-10, col=1:10, pch=19, main="oh hai dere")
cat(dev.off())

Run the code above in your browser using DataCamp Workspace