idev: Interative dev.print and pdf print

View source: R/utils.R

idevR Documentation

Interative dev.print and pdf print

Description

Execute dev.print only if R session is interactive.

Usage

idev(...)

ipdf(file, ...)

Arguments

...

Parameters passed to dev.print

file

PDF file name

Details

ipdf is a shortcut in case PDF is used as the device, with the twist that useDingbats is set to FALSE by default. See NOTE.

dev.print will make a R-script fail if the session is not interactive (e.g. when the script is excuted with the -f option from R command line). Function idev checks first whether the session is interative, and executes dev.print only if the session is interactive.

A commonly used shortcut is ipdf, which prints the current device to a PDF file.

Value

Side effect used.

Note

useDingbats is set to FALSE in ipdf. Setting the option to TRUE causes problem in importing the PDF to Inkscape, a vector-based figure modifying software. Though the option may reduces smaller and (according to the R manual) better output, we have noticed no difference.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

dev.print, pdf

Examples


tmfile <- tempfile()
plot(1:15, type="h")
idev(png, tmfile,width=600, height=800)
ipdf(tmfile)


bedapub/ribiosPlot documentation built on Sept. 1, 2023, 6:50 p.m.