Learn R Programming

⚠️There's a newer version (0.9-1) of this package.Take me there.

Presentation-Quality Tables, Displayed Using ggplot2

tablesgg is an R package that displays presentation-quality tables as plots on an R graphics device. Although there are other packages that format tables for display, this package is unique in combining two features:

  • It is aware of the logical structure of the table being presented, and makes

use of that for automatic layout and styling of the table. This avoids the need for most manual adjustments to achieve an attractive result.

  • It displays tables using ggplot2 graphics. Therefore a table can

be presented anywhere a graph could be, with no more effort. External software such as LaTeX or HTML or their viewers is not required.

Methods are included to display matrices; data frames; tables created by R's ftable(), table(), and xtabs() functions; and tables created by the tables and xtable packages. Methods can be added to display other table-like objects.

Other package features:

  • A full set of tools is provided to control the appearance

of tables, including titles, footnotes and reference marks, horizontal and vertical rules, and spacing of rows and columns. Many properties can be set automatically by specifying styles. Default styles are included, and the user can define custom styles.

  • There are tools for low-level manipulation of the appearance of

individual table elements if desired.

  • All sizes and dimensions in displayed tables are specified in physical

units (points for font size, millimeters for everything else). Therefore a plotted table has a well-defined physical size, independent of the size of the graphics device on which it is displayed. The user can easily increase or decrease the displayed size by a scale factor, maintaining the relative proportions of table elements.

  • Since the plotted tables are ordinary ggplot objects,

the facilities of ggplot2 and its various extension packages are available to modify or manipulate the table. For example, the table can be inserted as an image within another plot.

A vignette is included that illustrates usage and options available in the package.

Copy Link

Version

Install

install.packages('tablesgg')

Monthly Downloads

210

Version

0.8-1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Raubertas

Last Published

June 2nd, 2021

Functions in tablesgg (0.8-1)

adjacent_blocks

Identify Adjacent Blocks of Table Cells
add_refmark

Add a Reference Mark to a Character Vector or Matrix
addRefmark

Add a Reference Mark to Entries in a Table
blocks<-

Update the Blocks of a Plot-Ready or Plotted Table
blocks

Extract the prblocks Object from a Plot-Ready or Plotted Table
arow

Row Numbers Within the Augmented Row-Column Grid for a Table
apply_style

Apply a Style to Table Elements
as.prEntries

Promote a Data Frame to a prentries Object
angle_adj

Horizontal and Vertical Dimensions of a Rectangle after Rotation
as.prHvrules

Promote a Data Frame to a prhvrules Object
apply_scale

Apply a Scale Factor to Table Elements
[.textTable

Extract a Subset of a texttable Object
acol

Column Numbers Within the Augmented Row-Column Grid for a Table
as.tblBlocks

Promote a Data Frame to a tblblocks Object
addHvrule

Add a Horizontal or Vertical Rule (Hvrule) to a Table
addBlock

Define a New Block of Cells in a Table
as.dfObj

Promote a Data Frame to Another Object Class
entrySize_mm

Calculate the Sizes of Table Entries, in Mm
entries<-

Update the Table Entries of a Plot-Ready or Plotted Table
elements

Extract Table Elements from a Plotted Table
entries_by_block

Find the Entries that are Contained Within a Set of Table Blocks
entries

Extract the prentries Object from a Plot-Ready or Plotted Table
plot.pltdTable

Display a pltdtable Object on a Graphics Device
fill_NA_idx

Indices to Impute NA Elements of a Vector by LOCF
calc_rcsize

Constrained Display Sizes of Each Table Row, Column and Entry
format_xtable

Format Entries in an xtable into Character Strings
coord_justif

Calculate X, y Positions and H|vjust Values for Entries
iris2_tab

Table of Summary Statistics for Anderson's Iris Data
make_header_entries

Convert a Matrix of Headers to Table Entries, with Merging of Runs
plot.prEntries

A Plot Method for prentries Objects
plot.tabular

A Plot Method for tabular Objects
plot.prTable

A Plot Method for prtable Objects
as.prBlocks

Promote a Data Frame to a prblocks Object
props<-

Update Graphical Properties for Selected Table Elements
print.summary.textTable

Print the Dimensions of a Table and Its Parts
notANumber

Identify Strings that Cannot be Interpreted as Numbers
pltdSize

Width and Height of a pltdtable Object
dfSpecs

Specifications for Fields Used in Certain Object Classes
df_from_spec

Create a Data Frame from a Specification
paste_text

Paste Strings that may Include plotmath or Markdown
element_refmark

Specify a Reference Mark that can be Added to Table Entries
element_hvrule

Specify Visual Properties for Table Rules
as.tblEntries

Promote a Data Frame to a tblentries Object
hvrules

Extract the prhvrules Object from a Plot-Ready or Plotted Table
prBlocks

Assign Graphical Properties to Table Blocks
hvrules<-

Update the Hvrules of a Plot-Ready or Plotted Table
plot.tblEntries

A Plot Method for tblentries Objects
prTable.prEntries

Create a Plot-Ready Table from Plot-Ready Entry, Block, and Hvrule Objects
prTable

Create or Update a Fully Styled Table Ready for Plotting
propsd<-

Update Graphical Properties for Selected Table Elements
plot.textTable

A Plot Method for texttable Objects
prefix_text

Add or Remove the Prefix Associated with textspec Values
prTable.pltdTable

Extract/Update a Plot-Ready Table from a Plotted Table
element_block

Specify Visual Properties for Table Blocks
tblHvrules

Create Horizontal and Vertical Rules for a Table
element_entry

Specify Visual Properties for Table Entries and their Cells
grSpecs

Specifications for Graphical Properties for an Element Type
undo_rowhead_inside

Reverse the Effect of rowhead_inside
tblEntries

Assemble Information About Each Entry in a Table into a Data Frame
summary.pltdTable

Summarize the Dimensions and Options of a Plotted Table
update.pltdTable

Update a pltdtable (Plotted Table) Object
textTable.tabular

Create a texttable from a tabular Object
update.textTable

Update a texttable Object
summary.textTable

Summarize the Dimensions of a Table and Its Parts
textTable.table

Create a texttable from a table or xtabs Object
props_mod

Update Graphical Properties for Selected Table Elements
rowhead_inside

Move the Outermost Layer of Row Headers Inside a Table
tablesggOpt

Get or Reset Package Options
textTable.ftable

Create a texttable from an ftable
tablesgg-package

Presentation-Quality Tables, Displayed Using ggplot2
sci_fmt_pm

Convert ASCII Scientific Notation into plotmath Form
textTable

Create a Structure Representing a 2D Table
propsa<-

Update Graphical Properties for Selected Table Elements
spec_from_text

textspec Values Based on String Prefixes
tblParts

Extract Dimensions of the Various Parts of a Table
ids

Get the Identifier Strings for Parts or Elements of a Table
headerRuns

Runs of Repeated Values in a Header Matrix
iris2

A Reshaped Version of Anderson's Iris Data
prEntries

Assign Graphical Properties to Table Entries
make_rowgroups

Group Rows of a Table into Sets of Fixed Size
eval_conditions

Evaluate a Set of Logical Conditions Within a Data Frame
print.pltdTable

Print (Draw) a pltdtable Object
prHvrules

Create Hvrules and Assign Them Graphical Properties
tablesggSetOpt

Set the Values of Package Options
textTable.xtableList

Create a texttable from an xtablelist Object
tblBlocks

Define Blocks of Cells that Reflect the Logical Structure of a Table
textTable.matrix

Create a texttable from a Matrix
print.summary.pltdTable

Print the Dimensions and Display Options of a Plotted Table
textTable.tblEntries

Reconstruct a texttable Object from a tblentries Object
tli_xtab

Table of Test Scores and Demographics for 20 Students
mtcars_xtab

Table of Data from Motor Trend Magazine
textTable.data.frame

Create a texttable as a Simple Listing of a Data Frame
textTable.xtable

Create a texttable from an xtable Object
textTable.default

Create a texttable Object from a Suitable List
styles_pkg

Built-In Styles for Table Elements
update.prObj

Update Style or Scale for Plot-Ready Table Elements
update.prTable

Update a prtable (Plot-Ready Table) Object
styleObj

Create a Style Object
adim

Dimensions of the Augmented Row-Column Grid for a Table