Description Usage Arguments Value Note Author(s) See Also Examples
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
.
1 | deviceName(x, ...)
|
x |
the graphics device details, typically of class
|
... |
additional parameters for methods |
A character vector of length 1.
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.
Duncan Temple Lang
graphicsDevice
makeGraphicsDeviceObject
which is not exported.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.