Learn R Programming

xpose4 (version 4.5.0)

add.grid.table: Print tables or text in a grid object

Description

These functions take an array of values and labels or an array of text and add it to one or many grid viewports in an orderly fashion.

Usage

add.grid.table(txt,
               col.nams = NULL,
               ystart,
               xstart = unit(0, "npc"),
               start.pt = 1,
               vp,
               vp.num = 1,
               minrow = 5,
               cell.padding = 0.5,
               mult.col.padding = 1,
               col.optimize = TRUE,
               equal.widths = FALSE,
               space.before.table = 1,
               center.table = FALSE,
               use.rect=FALSE,
               fill.type=NULL, # all,top,side,both,NULL
               fill.col="grey",
               cell.lines.lty=0,
               ...)

add.grid.text(txt, ystart, xstart = unit(0, "npc"), start.pt = 1, vp, vp.num = 1, spaces.before = NULL, spaces.after = NULL, v.space.before=0, v.space.after=0, use.rect=FALSE, wdth=NULL, fill.type=NULL, fill.col="grey", cell.lines.lty=0, xpose.table=gTree(), ...)

Arguments

txt
The text or table values to add to the grid object.
col.nams
the column names of the table values
ystart
The y location to start printing in the grid viewport
xstart
The x location to start printing in the grid viewport
start.pt
The start point (row) in the table array to start printing
vp
The viewport(s) to add the table or text to
vp.num
the viewport number in vp to start printing to
minrow
The minimum rows before printing more columns to use in the table
cell.padding
padding between cells in the table
mult.col.padding
padding between multiple columns in the table
col.optimize
should we column optimize (TRUE) or row optimize (FALSE)
equal.widths
Should all columns have equal widths
space.before.table
Should there be a space before the table
center.table
should we center the table in the viewport?
use.rect
Should we make rectangles with background color around the table entries TRUE or FALSE
fill.type
Which rectangles should be filled. Allowed values are "all", "top", "side", "both" and NULL.
fill.col
The color of the filled rectangles
cell.lines.lty
The line-type for the lines between the cells, using the same values as lty.
spaces.before
Rows added before text is printed out
spaces.after
Rows added after text is printed out
v.space.before
Vertical space above text in a table in "lines" units.
v.space.after
Vertical space below text in a table in "lines" units.
wdth
The width of the column of data
xpose.table
A grob object.
...
Other arguments passed to the various functions.

Value

  • A List is returned with the following components
  • ystartnew starting point for new text
  • stop.ptnull if everything gets printed
  • vp.numthe viewport needed for next text printed
  • xpose.tableA grob object that can be plotted.

See Also

runsum, grid.text