deviceName {RGraphicsDevice}R Documentation

Get the description for a type of graphics device

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

deviceName(x, ...)

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

 
  setClass("RJSCanvasDevMethods", contains = "RDevDescMethods")
  setMethod("deviceName", "RJSCanvasDevMethods",
              function(x) 
                 "R JavaScript Canvas")

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

  dev = graphicsDevice(m)
  .Devices

[Package RGraphicsDevice version 0.2-0 Index]