deviceName: Get the description for a type of graphics device

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

Description

This function and its methods allow us to obtain a description or name of a graphics device which can be used as the string the .Devices list describing the device.

Programmers can provide a method for a new class of graphics device function list, i.e. a sub-class of RDevDescMethods.

Usage

1

Arguments

x

the graphics device details, typically of class RDevDescMethods or a sub-class thereof.

...

additional parameters for methods

Value

A character vector of length 1.

Note

When dealing with graphics devices implemented with R functions (via this package), we typically have a single class (DevDesc) of graphics device instance. Similarly, we can use the single generic RDevDescMethods class and specify different functions for different types of devices. Alternatively, we can define new sub-classes of RDevDescMethods which only differ by providing a class identifier to identify the type of device. We can then define a method for deviceName for such new sub-classes.

Author(s)

Duncan Temple Lang

See Also

graphicsDevice makeGraphicsDeviceObject which is not exported.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 
  setClass("RJSCanvasDevMethods", contains = "RDevDescMethods")
  setMethod("deviceName", "RJSCanvasDevMethods",
              function(x) 
                 "R JavaScript Canvas")

  m = new("RJSCanvasDevMethods")
  deviceName(m)

  dev = graphicsDevice(m)
  .Devices

omegahat/RGraphicsDevice documentation built on Jan. 18, 2022, 4:37 a.m.