plot.prTable: A Plot Method for 'prtable' Objects

Description Usage Arguments Details Value See Also

View source: R/plot.prTable.bare.R

Description

A plot method for prTable objects, to display tables using ggplot2 graphics. This is an internal function, not intended to be called by package users.

Usage

1
2
3
## S3 method for class 'prTable'
plot(x, plot.margin=tablesggOpt("plot.margin"), sizeAdjust=c(1.0, 
    1.0), ...)

Arguments

x

A prTable object, containing a plot-ready table.

plot.margin

Numeric vector of length 4, giving the amount of padding to be added outside the top, right, bottom, and left sides of the table, in millimeters.

sizeAdjust

Two-element numeric vector containing multipliers to adjust the calculated absolute size of table text. The first element is applied to the horizontal dimension and the second to the vertical dimension. See DETAILS.

...

Other arguments, ignored with a warning. (Included for compatibility with the plot generic.)

Details

The implicit coordinate system for the plot is in millimeters, with the origin at the upper left corner of the _table_ (which may differ from the upper left corner of the plot due to plot.margin), and y-coordinates increasing downward. All sizes and dimensions are in millimeters except font size, which is in points.

The print method for pltdTable objects attempts to draw the table at its natural size, as given by attribute size_mm. (Function pltdSize provides convenient access to this attribute, in user-controllable units.) However the calculated size depends slightly on the graphics device being used (see ?Devices). sizeAdjust may be used to compensate for this difference when a plotted table object created using one device is to be displayed with a different one.

This function checks the enabled field of the entries, blocks, and hvrules components of x. Elements for which enabled is FALSE are not displayed, and their size is treated as 0 when laying out the table.

Value

An object of S3 class pltdTable, inheriting from ggplot. (However if x has no enabled entries to plot, the returned value is NULL, with a warning.) There is a print (display) method for this class, or the object can be modified in the usual ggplot way before display.

The object has attributes plot.margin and sizeAdjust (equal to the arguments), and size_mm (the width and height of the plot, in millimeters). size_mm is calculated after applying sizeAdjust, and includes both the table and any margins specified by plot.margin.

The object also has attributes colBoundaries and rowBoundaries giving the coordinates of the boundaries between columns and between rows, again in mm, and after applying sizeAdjust.

The object also has attribute prTable, the plot-ready table object x. This is to allow convenient updating of the display properties of the table.

See Also

prTable, pltdSize, print.pltdTable, Devices, calc_rcsize, coord_justif


tablesgg documentation built on June 3, 2021, 1:06 a.m.