pltdSize: Width and Height of a 'pltdtable' Object

View source: R/pltdTable_util.bare.R

pltdSizeR Documentation

Width and Height of a pltdtable Object

Description

Width and height of a pltdTable object.

Usage

pltdSize(x, units=c("mm", "inches", "cm"))

Arguments

x

An object of class pltdTable, the result of plotting a textTable object.

units

String specifying the units in which size is to be returned. May be abbreviated.

Details

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.

Value

Two-element numeric vector containing the (width, height) of the plot. It has attributes units and device.

See Also

plot.textTable

Examples

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
  

tablesgg documentation built on June 22, 2024, 11:02 a.m.