Learn R Programming

gt (version 0.11.1)

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.11.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

October 4th, 2024

Functions in gt (0.11.1)

as.data.frame.gt_tbl

Transform a gt object to a data frame
as_word

Output a gt object as Word
as_rtf

Output a gt object as RTF
as_latex

Output a gt object as LaTeX
cell_borders

Helper for defining custom borders for table cells
as_raw_html

Get the HTML content of a gt table
as_gtable

Transform a gt table to a gtable object
adjust_luminance

Adjust the luminance for a palette of colors
cell_text

Helper for defining custom text styles for table cells
cell_fill

Helper for defining custom fills for table cells
cells_body

Location helper for targeting data cells in the table body
cells_group

Location helper for targeting row groups (deprecated)
cells_row_groups

Location helper for targeting row groups
cells_column_spanners

Location helper for targeting the column spanners
cells_stub

Location helper for targeting cells in the table stub
cells_footnotes

Location helper for targeting the footnotes
cells_source_notes

Location helper for targeting the source notes
cells_stub_grand_summary

Location helper for targeting the stub cells in a grand summary
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_stubhead

Location helper for targeting the table stubhead cell
cols_add

Add one or more columns to a gt table
cols_label

Relabel one or more columns
cols_label_with

Relabel columns with a function
cells_summary

Location helper for targeting group summary cells
cols_hide

Hide one or more columns
cols_align

Set the alignment of columns
cells_title

Location helper for targeting the table title and subtitle
cols_align_decimal

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

Merge two columns to combine counts and percentages
cols_unhide

Unhide one or more columns
cols_move

Move one or more columns
cols_merge

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

Merge two columns to a value range column
cols_nanoplot

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

Move one or more columns to the end
cols_move_to_start

Move one or more columns to the start
cols_merge_uncert

Merge columns to a value-with-uncertainty column
cols_units

Define units for one or more columns
countrypops

Yearly populations of countries from 1960 to 2023
extract_body

Extract the table body from a gt object
data_color

Perform data cell colorization
extract_cells

Extract a vector of formatted cells from a gt object
default_fonts

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

Supply a custom currency symbol to fmt_currency()
escape_latex

Perform LaTeX escaping
constants

The fundamental physical constants
cols_width

Set the widths of columns
exibble

A toy example tibble for testing with gt: exibble
films

Feature films in competition at the Cannes Film Festival
fmt_currency

Format values as currencies
fmt

Set a column format with a formatter function
extract_summary

Extract a summary list from a gt object
fmt_bins

Format column data containing bin/interval information
fmt_country

Generate country names from their corresponding country codes
fmt_chem

Format chemical formulas
fmt_bytes

Format values as bytes
fmt_date

Format values as dates
fmt_auto

Automatically format column data according to their values