Description Objects from the Class Slots Extends Methods Author(s) References See Also Examples
The DevDescPtr class represents a C-level data structure
that corresponds to an existing R graphics device. If the device
is active, R graphics commands will cause the device's graphical
operators to be called.
We typically obtain a reference to the graphics device
via the function graphicsDevice.
It is also passed as an argument in each call to the R functions that operate as graphical
primitives for the R-level graphics device.
We can query and set the state of the device treating it like a list
in R.
We can then access the individual fields, querying and setting their
values using the regular R operators [[ and \$, e.g.
dev$left and dev$right = 1000.
Objects of class DevDescPtr are created by the R graphics engine
in C code and via the function graphicsDevice. We do not
create them ourselves.
On occassion, it might be useful to convert the reference to the C
structure to an R structure, i.e. one with the corresponding slots
and the values as R vectors, etc. We use the DevDesc class
for this and we can convert using the as
function, e.g. as(dev, "DevDesc").
left:Object of class "numeric" typically 0
right:Object of class "numeric" typically the
width of the device
bottom:Object of class "numeric" typically the
height of the device
top:Object of class "numeric" typically 0
clipLeft:Object of class "numeric" typically 0
clipRight:Object of class "numeric"
clipBottom:Object of class "numeric"
clipTop:Object of class "numeric"
xCharOffset:Object of class "numeric"
yCharOffset:Object of class "numeric"
yLineBias:Object of class "numeric"
ipr:Object of class "numeric" number of inches per raster "pixel"
cra:Object of class "numeric" the size (width
and height) of a character in rasters
gamma:Object of class "numeric" the gamma correction
canClip:Object of class "Rboolean" a logical
value indicating whether the device can perform clipping operations
itself or whether they should be done (more crudely) by R's graphics engine
canChangeGamma:Object of class "Rboolean" a
logical value indicating whether the gamma value can be changed during
the life of the device.
canHAdj:Object of class "integer" a value
specifying whether the device can do horizontal
alignment/justification. This can be one of 0, 1 or 2.
startps:Object of class "numeric" the initial
value for the point size, i.e. size of the "font"
startcol:Object of class "integer", the
default color for the pen for drawing lines, curves, etc.
startfill:Object of class "integer" the
default value for the fill color
startlty:Object of class "integer" the
initial/default value for the line type
startfont:Object of class "integer" the
default setting for the font.
startgamma:Object of class "numeric" the
default value for the gamma correction.
deviceSpecific:a reference to the
RDevDescMethodsPtr object in C that contains the collection
of R functions that implement this C-level graphics device.
One can coerce this to an RDevDescM
displayListOn:Object of class "Rboolean"
canGenMouseDown:Object of class "Rboolean"
canGenMouseMove:Object of class "Rboolean"
canGenMouseUp:Object of class "Rboolean"
canGenKeybd:Object of class "Rboolean"
gettingEvent:Object of class "Rboolean"
hasTextUTF8:Object of class "Rboolean"
wantSymbolUTF8:Object of class "Rboolean"
useRotatedTextInContour:Object of class "Rboolean"
Class "CStruct-class", directly.
signature(x = "DevDescPtr"): these methods
allow one to query and set the values of the individual fiels
signature(x = "DevDescPtr"):
signature(x = "DevDescPtr"):
signature(x = "DevDescPtr"):
signature(x = "DevDescPtr"): this method allows
us to convert the C-level reference to an R-level DevDesc
object using regular coercion, i.e. as(dev, "DevDesc").
Duncan Temple Lang
“The R Internals Manual”, R Development Core Team.
1 | showClass("DevDesc")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.