tableplot | R Documentation |
Add a table to a base plot.
tableplot(
x,
y = NULL,
table,
title = NULL,
rownames = NULL,
colnames = NULL,
bg = "transparent",
cex = par("cex"),
cex.title = cex,
xjust = 0,
yjust = 1,
xpad = 0.25,
ypad = 0.75,
col.table = 1L,
col.title = col.table,
col.colnames = col.table,
col.rownames = col.table,
font.table = 1L,
font.title = font.table,
font.colnames = font.table,
font.rownames = font.table,
show.colnames = TRUE,
show.rownames = FALSE,
hlines = FALSE,
vlines = FALSE,
frame.colnames = FALSE,
frame.title = FALSE,
frame.table = FALSE,
frame.rownames = FALSE,
frame.type = c("box", "box", "line", "box"),
...
)
x, y |
the x- and y-coordinates to be used or a keyword; see
|
table |
a data frame or matrix |
title |
optional title for the table |
rownames, colnames |
optional labels for rows and columns (default
are |
bg |
background color for each table cell, recycled as needed |
cex, cex.title |
text size for table, title |
xjust, yjust |
table position relative to |
xpad, ypad |
padding around text in cells as a proportion of the max width and height of the strings in each column |
col.table, col.title, col.colnames, col.rownames |
colors for table, title, column names, and row names |
font.table, font.title, font.colnames, font.rownames |
fonts for table, title, column names, and row names |
show.colnames, show.rownames |
logical; if |
hlines, vlines |
logical; if |
frame.colnames, frame.title, frame.table, frame.rownames |
logical; if
|
frame.type |
a vector giving the type of framing for column names,
title, table, and row names, respectively; options are |
... |
additional graphical parameters passed to |
A list with components table
, colnames
, title
, and
outline
giving the coordinates of the rectangle for each.
addtable2plot
tbl <- head(mtcars, 3)
plot(mpg ~ wt, mtcars)
tableplot(
'topright', table = tbl,
title = 'mtcars data set', cex.title = 2
)
tableplot(
par('usr')[1], 35, tbl[, 1:3],
show.rownames = TRUE, col.rownames = 1:3,
font.colnames = 2, hlines = TRUE
)
tableplot(
'bottomleft', table = tbl[, 1:3], col.table = 1:3,
show.rownames = TRUE, frame.rownames = TRUE, frame.type = 'bbll'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.