findPngDevice.Device: Searches for a working PNG device

Description Usage Arguments Value Author(s) See Also Examples

Description

Searches for a working PNG device.

On Unix, the png device requires that X11 is available, which it is not when running batch scripts or running R remotely.

This method tries to create a simple png file first using the png() device, and if that is not working it tries the bitmap() device, which does not require X11 etc, because it utilizes Ghostscript.

Usage

1

Arguments

...

Not used.

Value

Returns the png function, the bitmap function, or NULL.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

For more information see Device.

Examples

1
2
3
4
5
6
7
8
9
   fcn <- Device$findPngDevice();
   if (identical(fcn, png)) {
     cat("PNG device found: png()");
   } else if (identical(fcn, bitmap)) {
     cat("PNG device found: bitmap()");
   } else {
     cat("PNG device not found.");
   }
 

HenrikBengtsson/R.graphics documentation built on May 6, 2019, 11:53 p.m.