addTable: Add Table to Graph

View source: R/addTable.R

addTableR Documentation

Add Table to Graph

Description

Adds a small table to a graph.

Usage

addTable(tbl, where = "ll", title = "")

Arguments

tbl

the data frame or matrix to add to graph. All data must be of mode character, which allows the user to format the data rather than the automatic formatting done by R.

where

character specifying the corner the table should be placed, see Details.

title

the title of the table.

Details

where must be one of "ul," "ur," "ll," or "lr." The first letter is an abbreviation for upper or lower, the second letter is an abbreviation for left or right.

Value

Nothing is returned.

Note

Each column of the table can be formatted by the user, using the format function, to control the alingment of the data in each column of the table. The column names of the table are the column names of the matrix or data frame. If there are no column names in a matrix, then the table is printed without column names. A matrix gives the user more control over column names than does a data frame.

See Also

addExplanation, addAnnotation

Examples

## Not run: 
set.seed(1)
X <- rnorm(32)
Y <- X + rnorm(32)
setGD()
AA.pl <- xyPlot(X, Y)
Mat <- cbind(c("Mean of X", "Mean of Y"), round(c(mean(X), mean(Y)), 2))
addTable(Mat, "ul")
# For more details of addTable see
vignette(topic="GraphAdditions", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.