pltdSize {tablesgg} | R Documentation |
pltdtable
Object Width and height of a pltdTable
object.
pltdSize(x, units=c("mm", "inches", "cm"))
x |
An object of class |
units |
String specifying the units in which size is to be returned. May be abbreviated. |
This function returns the size, after any scaling, of a plotted table, in physical units. The default units are millimeters to be consistent with other dimensions used in plotting tables. Inches may be useful because that is what R's graphics device functions use.
The size of a plot can depend slightly on the graphics device used to create or render it. The device name used internally to create the plot is included as an attribute of the returned value.
Two-element numeric vector containing the (width, height) of the plot. It
has attributes units
and device
.
plt <- plot(iris2_tab, title="Summary statistics for the iris data")
pltdSize(plt) # width, height in millimeters
# Open a graphics device just the right size to hold the table:
sz <- pltdSize(plt, units="in")
dev.new(width=sz[1], height=sz[2], noRStudioGD=TRUE)
plt