Learn R Programming

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

gt (version 0.5.0)

Easily Create Presentation-Ready Display Tables

Description

Build display tables from tabular data with an easy-to-use set of functions. With its progressive approach, we can construct display tables with a cohesive set of table parts. Table values can be formatted using any of the included formatting functions. Footnotes and cell styles can be precisely added through a location targeting system. The way in which 'gt' handles things for you means that you don't often have to worry about the fine details.

Copy Link

Version

Install

install.packages('gt')

Monthly Downloads

212,200

Version

0.5.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Iannone

Last Published

April 21st, 2022

Functions in gt (0.5.0)

cells_column_labels

Location helper for targeting the column labels
as_rtf

Output a gt object as RTF
cell_fill

Helper for defining custom fills for table cells
adjust_luminance

Adjust the luminance for a palette of colors
as_latex

Output a gt object as LaTeX
cell_borders

Helper for defining custom borders for table cells
cells_body

Location helper for targeting data cells in the table body
cell_text

Helper for defining custom text styles for table cells
as.data.frame.gt_tbl

Transform a gt object to a data frame
as_raw_html

Get the HTML content of a gt table
cells_grand_summary

Location helper for targeting cells in a grand summary
cells_source_notes

Location helper for targeting the source notes
cells_row_groups

Location helper for targeting row groups
cells_stub_summary

Location helper for targeting the stub cells in a summary
cells_stubhead

Location helper for targeting the table stubhead cell
cells_group

Location helper for targeting row groups (deprecated)
cells_stub_grand_summary

Location helper for targeting the stub cells in a grand summary
cells_title

Location helper for targeting the table title and subtitle
cells_summary

Location helper for targeting group summary cells
cells_stub

Location helper for targeting cells in the table stub
cols_label

Relabel one or more columns
cols_merge

Merge data from two or more columns to a single column
cells_footnotes

Location helper for targeting the footnotes
cols_move

Move one or more columns
cols_merge_uncert

Merge columns to a value-with-uncertainty column
cells_column_spanners

Location helper for targeting the column spanners
cols_move_to_end

Move one or more columns to the end
escape_latex

Perform LaTeX escaping
exibble

A toy example tibble for testing with gt: exibble
cols_merge_n_pct

Merge two columns to combine counts and percentages
cols_merge_range

Merge two columns to a value range column
cols_move_to_start

Move one or more columns to the start
countrypops

Yearly populations of countries from 1960 to 2017
cols_align

Set the alignment of columns
fmt_date

Format values as dates
currency

Supply a custom currency symbol to fmt_currency()
data_color

Set data cell colors using a palette or a color function
fmt_fraction

Format values as a mixed fractions
fmt_number

Format numeric values
info_date_style

View a table with info on date styles
fmt_engineering

Format values to engineering notation
info_currencies

View a table with info on supported currencies
fmt_missing

Format missing values
opt_horizontal_padding

Option to expand or contract horizontal padding
fmt_scientific

Format values to scientific notation
fmt_datetime

Format values as date-times
default_fonts

A vector of default fonts for use with gt tables
cols_hide

Hide one or more columns
fmt_time

Format values as times
cols_unhide

Unhide one or more columns
opt_row_striping

Option to add or remove row striping
render_gt

A gt display table render function for use in Shiny
fmt

Set a column format with a formatter function
extract_summary

Extract a summary list from a gt object
fmt_integer

Format values as integers
fmt_currency

Format values as currencies
google_font

Helper function for specifying a font from the Google Fonts service
fmt_bytes

Format values as bytes
ggplot_image

Helper function for adding a ggplot
gt_preview

Preview a gt table object
row_group_order

Modify the ordering of any row groups
tab_spanner

Add a spanner column label
cols_width

Set the widths of columns
gtsave

Save a gt table as a file
gtcars

Deluxe automobiles from the 2014-2017 period
tab_spanner_delim

Create column labels and spanners via delimited names
fmt_markdown

Format Markdown text
gt_latex_dependencies

Get the LaTeX dependencies required for a gt table
fmt_percent

Format values as a percentage
fmt_passthrough

Format by simply passing data through
gt_output

Create a gt display table output element for Shiny
local_image

Helper function for adding a local image
info_locales

View a table with info on supported locales
info_google_fonts

View a table on recommended Google Fonts
html

Interpret input text as HTML-formatted text
info_paletteer

View a table with info on color palettes
opt_align_table_header

Option to align the table header
random_id

Helper for creating a random id for a gt table
reexports

Objects exported from other packages
tab_header

Add a table header
opt_all_caps

Option to use all caps in select table locations
tab_options

Modify the table output options
opt_table_font

Option to define a custom font for the table
info_time_style

View a table with info on time styles
tab_stubhead

Add label text to the stubhead
opt_table_lines

Option to set table lines to different extents
tab_style

Add custom styles to one or more cells
pct

Helper for providing a numeric value as percentage
md

Interpret input text as Markdown-formatted text
%>%

Pipe operator
grand_summary_rows

Add grand summary rows using aggregation functions
opt_table_outline

Option to wrap an outline around the entire table
summary_rows

Add groupwise summary rows using aggregation functions
opt_vertical_padding

Option to expand or contract vertical padding
sp500

Daily S&P 500 Index data from 1950 to 2015
text_transform

Perform targeted text transformation with a function
test_image

Generate a path to a test image
gt-options

gt package options
print.rtf_text

Print RTF text
gt-package

gt: Easily Create Presentation-Ready Display Tables
gt

Create a gt table object
opt_css

Option to add custom CSS for the table
sza

Twice hourly solar zenith angles by month & latitude
tab_row_group

Add a row group to a gt table
tab_footnote

Add a table footnote
opt_footnote_marks

Option to modify the set of footnote marks
tab_source_note

Add a source note citation
print.gt_tbl

Print the table
pizzaplace

A year of pizza sales from a pizza place
px

Helper for providing a numeric value as pixels value
web_image

Helper function for adding an image from the web