DevDesc-class {unknown} | R Documentation |
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
:"numeric"
right
:"numeric"
bottom
:"numeric"
top
:"numeric"
clipLeft
:"numeric"
clipRight
:"numeric"
clipBottom
:"numeric"
clipTop
:"numeric"
xCharOffset
:"numeric"
yCharOffset
:"numeric"
yLineBias
:"numeric"
ipr
:"numeric"
cra
:"numeric"
gamma
:"numeric"
canClip
:"Rboolean"
canChangeGamma
:"Rboolean"
canHAdj
:"integer"
startps
:"numeric"
startcol
:"integer"
startfill
:"integer"
startlty
:"integer"
startfont
:"integer"
startgamma
:"numeric"
deviceSpecific
:"raw"
displayListOn
:"Rboolean"
canGenMouseDown
:"Rboolean"
canGenMouseMove
:"Rboolean"
canGenMouseUp
:"Rboolean"
canGenKeybd
:"Rboolean"
gettingEvent
:"Rboolean"
hasTextUTF8
:"Rboolean"
wantSymbolUTF8
:"Rboolean"
useRotatedTextInContour
:"Rboolean"
Class "CStruct-class"
, directly.
signature(x = "DevDescPtr")
: these methods
allow one to query and set the values of the individual fielssignature(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.
showClass("DevDesc")