Learn R Programming

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

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

153,775

Version

0.7.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 25th, 2022

Functions in gt (0.7.0)

as_word

Output a gt object as Word
as_rtf

Output a gt object as RTF
cell_text

Helper for defining custom text styles for table cells
adjust_luminance

Adjust the luminance for a palette of colors
as_latex

Output a gt object as LaTeX
cell_fill

Helper for defining custom fills for table cells
as_raw_html

Get the HTML content of a gt table
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
cell_borders

Helper for defining custom borders for table cells
cells_row_groups

Location helper for targeting row groups
cells_source_notes

Location helper for targeting the source notes
cells_column_labels

Location helper for targeting the column labels
cells_grand_summary

Location helper for targeting cells in a grand summary
cells_stub_summary

Location helper for targeting the stub cells in a summary
cells_column_spanners

Location helper for targeting the column spanners
cells_stub_grand_summary

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

Location helper for targeting the footnotes
cells_stub

Location helper for targeting cells in the table stub
cells_group

Location helper for targeting row groups (deprecated)
cols_merge_uncert

Merge columns to a value-with-uncertainty column
cols_merge

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

Merge two columns to combine counts and percentages
cols_hide

Hide one or more columns
cells_summary

Location helper for targeting group summary cells
cells_title

Location helper for targeting the table title and subtitle
cells_stubhead

Location helper for targeting the table stubhead cell
cols_align

Set the alignment of columns
cols_label

Relabel one or more columns
cols_merge_range

Merge two columns to a value range column
cols_width

Set the widths of columns
cols_move_to_end

Move one or more columns to the end
default_fonts

A vector of default fonts for use with gt tables
countrypops

Yearly populations of countries from 1960 to 2017
data_color

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

Move one or more columns
currency

Supply a custom currency symbol to fmt_currency()
cols_move_to_start

Move one or more columns to the start
escape_latex

Perform LaTeX escaping
cols_unhide

Unhide one or more columns
fmt_bytes

Format values as bytes
fmt_fraction

Format values as a mixed fractions
fmt_duration

Format numeric or duration values as styled time duration strings
fmt_datetime

Format values as date-times
fmt_date

Format values as dates
exibble

A toy example tibble for testing with gt: exibble
extract_summary

Extract a summary list from a gt object
fmt_engineering

Format values to engineering notation
fmt

Set a column format with a formatter function
fmt_currency

Format values as currencies
fmt_partsper

Format values as parts-per quantities
fmt_time

Format values as times
ggplot_image

Helper function for adding a ggplot
fmt_missing

Format missing values (deprecated)
fmt_integer

Format values as integers
fmt_markdown

Format Markdown text
fmt_scientific

Format values to scientific notation
fmt_passthrough

Format by simply passing data through
fmt_number

Format numeric values
fmt_percent

Format values as a percentage
gt

Create a gt table object
gt_preview

Preview a gt table object
grand_summary_rows

Add grand summary rows using aggregation functions
gt-options

gt package options
google_font

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

Create a gt display table output element for Shiny
gtsave

Save a gt table as a file
gt_latex_dependencies

Get the LaTeX dependencies required for a gt table
gt-package

gt: Easily Create Presentation-Ready Display Tables
gtcars

Deluxe automobiles from the 2014-2017 period
info_currencies

View a table with info on supported currencies
opt_align_table_header

Option to align the table header
html

Interpret input text as HTML-formatted text
info_time_style

View a table with info on time styles
local_image

Helper function for adding a local image
info_date_style

View a table with info on date styles
info_google_fonts

View a table on recommended Google Fonts
info_locales

View a table with info on supported locales
info_paletteer

View a table with info on color palettes
opt_all_caps

Option to use all caps in select table locations
opt_stylize

Stylize your table with a colorful look
opt_table_lines

Option to set table lines to different extents
md

Interpret input text as Markdown-formatted text
opt_row_striping

Option to add or remove row striping
opt_horizontal_padding

Option to expand or contract horizontal padding
opt_table_outline

Option to wrap an outline around the entire table
print.gt_tbl

Print the table
reexports

Objects exported from other packages
pct

Helper for providing a numeric value as percentage
render_gt

A gt display table render function for use in Shiny
px

Helper for providing a numeric value as pixels value
row_group_order

Modify the ordering of any row groups
%>%

Pipe operator
pizzaplace

A year of pizza sales from a pizza place
opt_table_font

Option to define a custom font for the table
opt_vertical_padding

Option to expand or contract vertical padding
opt_footnote_marks

Option to modify the set of footnote marks
opt_css

Option to add custom CSS for the table
random_id

Helper for creating a random id for a gt table
print.rtf_text

Print RTF text
sub_zero

Substitute zero values in the table body
sp500

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

Substitute missing values in the table body
summary_rows

Add groupwise summary rows using aggregation functions
tab_footnote

Add a table footnote
sub_large_vals

Substitute large values in the table body
sza

Twice hourly solar zenith angles by month & latitude
sub_small_vals

Substitute small values in the table body
tab_header

Add a table header
tab_options

Modify the table output options
test_image

Generate a path to a test image
tab_row_group

Add a row group to a gt table
tab_spanner

Add a spanner column label
tab_stub_indent

Control indentation of row labels in the stub
tab_style

Add custom styles to one or more cells
tab_spanner_delim

Create column labels and spanners via delimited names
tab_stubhead

Add label text to the stubhead
text_transform

Perform targeted text transformation with a function
vec_fmt_bytes

Format a vector as values in terms of bytes
tab_source_note

Add a source note citation
vec_fmt_number

Format a vector as numeric values
vec_fmt_date

Format a vector as date values
vec_fmt_engineering

Format a vector as values in engineering notation
vec_fmt_markdown

Format a vector containing Markdown text
vec_fmt_duration

Format a vector of numeric or duration values as styled time duration strings
vec_fmt_integer

Format a vector as integer values
vec_fmt_currency

Format a vector as currency values
vec_fmt_datetime

Format a vector as date-time values
vec_fmt_partsper

Format a vector as parts-per quantities
vec_fmt_fraction

Format a vector as mixed fractions
web_image

Helper function for adding an image from the web
vec_fmt_time

Format a vector as time values
vec_fmt_scientific

Format a vector as values in scientific notation
vec_fmt_percent

Format a vector as percentage values