Learn R Programming

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

252,322

Version

1.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Iannone

Last Published

April 5th, 2025

Functions in gt (1.0.0)

as_word

Output a gt object as Word
as_raw_html

Get the HTML content of a gt table
as_rtf

Output a gt object as RTF
cell_borders

Helper for defining custom borders for table cells
cell_fill

Helper for defining custom fills for table cells
as.data.frame.gt_tbl

Transform a gt object to a data frame
adjust_luminance

Adjust the luminance for a palette of colors
cell_text

Helper for defining custom text styles for table cells
as_gtable

Transform a gt table to a gtable object
as_latex

Output a gt object as LaTeX
cells_grand_summary

Location helper for targeting cells in a grand summary
cells_column_spanners

Location helper for targeting the column spanners
cells_body

Location helper for targeting data cells in the table body
cells_column_labels

Location helper for targeting the column labels
cells_group

Location helper for targeting row groups (deprecated)
cells_footnotes

Location helper for targeting the footnotes
cells_stub

Location helper for targeting cells in the table stub
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
cols_align_decimal

Align all numeric values in a column along the decimal mark
cols_add

Add one or more columns to a gt table
cells_stub_grand_summary

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

Set the alignment of columns
cols_hide

Hide one or more columns
cols_label_with

Relabel columns with a function
cols_label

Relabel one or more columns
cells_stubhead

Location helper for targeting the table stubhead cell
cells_summary

Location helper for targeting group summary cells
cells_title

Location helper for targeting the table title and subtitle
cols_merge_range

Merge two columns to a value range column
cols_move_to_start

Move one or more columns to the start
cols_move

Move one or more columns
cols_unhide

Unhide one or more columns
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_merge_uncert

Merge columns to a value-with-uncertainty column
cols_move_to_end

Move one or more columns to the end
cols_nanoplot

Add a new column of nanoplots, taking input data from selected columns
cols_units

Define units for one or more columns
exibble

A toy example tibble for testing with gt: exibble
currency

Supply a custom currency symbol to fmt_currency()
default_fonts

Provide a vector of sensible system fonts for use with gt tables
escape_latex

Perform LaTeX escaping
data_color

Perform data cell colorization
cols_width

Set the widths of columns
constants

The fundamental physical constants
countrypops

Yearly populations of countries from 1960 to 2023
extract_body

Extract the table body from a gt object
extract_cells

Extract a vector of formatted cells from a gt object
fmt_chem

Format chemical formulas
fmt_country

Generate country names from their corresponding country codes
fmt_bins

Format column data containing bin/interval information
fmt_currency

Format values as currencies
fmt_date

Format values as dates
fmt

Set a column format with a formatter function
fmt_bytes

Format values as bytes
fmt_auto

Automatically format column data according to their values
extract_summary

Extract a summary list from a gt object
films

Feature films in competition at the Cannes Film Festival