Learn R Programming

tablesgg (version 0.9-1)

pltdSize: Width and Height of a pltdtable Object

Description

Width and height of a pltdTable object.

Usage

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

Value

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

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.

See Also

plot.textTable

Examples

Run this code
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
  

Run the code above in your browser using DataLab