Learn R Programming

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

gt (version 0.4.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

200,105

Version

0.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Iannone

Last Published

February 15th, 2022

Functions in gt (0.4.0)

cell_fill

Helper for defining custom fills for table cells
as_rtf

Output a gt object as RTF
as_latex

Output a gt object as LaTeX
as_raw_html

Get the HTML content of a gt table
cell_borders

Helper for defining custom borders for table cells
adjust_luminance

Adjust the luminance for a palette of colors
as.data.frame.gt_tbl

Transform a gt object to a data frame
cells_body

Location helper for targeting data cells in the table body
cells_column_labels

Location helper for targeting the column labels
cell_text

Helper for defining custom text styles for table cells
cells_row_groups

Location helper for targeting row groups
cols_merge_range

Merge two columns to a value range column
cells_group

Location helper for targeting row groups (deprecated)
cells_grand_summary

Location helper for targeting cells in a grand summary
cells_footnotes

Location helper for targeting the footnotes
cols_merge_n_pct

Merge two columns to combine counts and percentages
cells_column_spanners

Location helper for targeting the column spanners
cols_merge_uncert

Merge two columns to a value & uncertainty column
cells_stub_summary

Location helper for targeting the stub cells in a summary
cells_stub

Location helper for targeting cells in the table stub
cols_move_to_end

Move one or more columns to the end
cols_move

Move one or more columns
extract_summary

Extract a summary list from a gt object
cells_source_notes

Location helper for targeting the source notes
fmt

Set a column format with a formatter function
fmt_markdown

Format Markdown text
currency

Supply a custom currency symbol to fmt_currency()
countrypops

Yearly populations of countries from 1960 to 2017
fmt_integer

Format values as integers
fmt_missing

Format missing values
fmt_number

Format numeric values
fmt_percent

Format values as a percentage
fmt_passthrough

Format by simply passing data through
cells_stubhead

Location helper for targeting the table stubhead cell
cols_align

Set the alignment of columns
cells_stub_grand_summary

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

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

Relabel one or more columns
data_color

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

Location helper for targeting group summary cells
cols_hide

Hide one or more columns
info_paletteer

View a table with info on color palettes
info_time_style

View a table with info on time styles
cols_width

Set the widths of columns
cells_title

Location helper for targeting the table title and subtitle
cols_unhide

Unhide one or more columns
opt_horizontal_padding

Option to expand or contract horizontal padding
escape_latex

Perform LaTeX escaping
cols_move_to_start

Move one or more columns to the start
exibble

A toy example tibble for testing with gt: exibble
default_fonts

A vector of default fonts for use with gt tables
fmt_engineering

Format values to engineering notation
fmt_fraction

Format values as a mixed fractions
gtsave

Save a gt table as a file
grand_summary_rows

Add grand summary rows using aggregation functions
gt-options

gt package options
opt_row_striping

Option to add or remove row striping
random_id

Helper for creating a random id for a gt table
fmt_date

Format values as dates
html

Interpret input text as HTML-formatted text
gt_preview

Preview a gt table object
gtcars

Deluxe automobiles from the 2014-2017 period
fmt_scientific

Format values to scientific notation
fmt_datetime

Format values as date-times
opt_table_outline

Option to wrap an outline around the entire table
opt_vertical_padding

Option to expand or contract vertical padding
reexports

Objects exported from other packages
fmt_time

Format values as times
text_transform

Perform targeted text transformation with a function
test_image

Generate a path to a test image
sp500

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

View a table on recommended Google Fonts
gt-package

gt: Easily Create Presentation-Ready Display Tables
fmt_bytes

Format values as bytes
info_locales

View a table with info on supported locales
web_image

Helper function for adding an image from the web
info_date_style

View a table with info on date styles
opt_footnote_marks

Option to modify the set of footnote marks
info_currencies

View a table with info on supported currencies
opt_css

Option to add custom CSS for the table
pizzaplace

A year of pizza sales from a pizza place
gt

Create a gt table object
fmt_currency

Format values as currencies
print.gt_tbl

Print the table
ggplot_image

Helper function for adding a ggplot
google_font

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

Add groupwise summary rows using aggregation functions
opt_align_table_header

Option to align the table header
gt_latex_dependencies

Get the LaTeX dependencies required for a gt table
opt_all_caps

Option to use all caps in select table locations
gt_output

Create a gt display table output element for Shiny
px

Helper for providing a numeric value as pixels value
print.rtf_text

Print RTF text
pct

Helper for providing a numeric value as percentage
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
tab_stubhead

Add label text to the stubhead
render_gt

A gt display table render function for use in Shiny
row_group_order

Modify the ordering of any row groups
opt_table_lines

Option to set table lines to different extents
md

Interpret input text as Markdown-formatted text
local_image

Helper function for adding a local image
opt_table_font

Option to define a custom font for the table
tab_style

Add custom styles to one or more cells
tab_header

Add a table header
tab_options

Modify the table output options
%>%

Pipe operator
tab_spanner

Add a spanner column label
tab_spanner_delim

Create column labels and spanners via delimited names
tab_source_note

Add a source note citation