Learn R Programming

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

gt

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.

License

MIT © RStudio, PBC

Copy Link

Version

Install

install.packages('gt')

Monthly Downloads

199,936

Version

0.2.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 5th, 2020

Functions in gt (0.2.2)

as_latex

Output a gt object as LaTeX
as_rtf

Output a gt object as RTF
cell_borders

Helper for defining custom borders for table cells
cols_hide

Hide one or more columns
cells_row_groups

Location helper for targeting row groups
cells_data

Location helper for targeting data cells in the table body (deprecated)
cells_column_spanners

Location helper for targeting the column spanners
cols_label

Relabel one or more columns
escape_latex

Perform LaTeX escaping
default_fonts

A vector of default fonts for use with gt tables
cells_group

Location helper for targeting row groups (deprecated)
cells_grand_summary

Location helper for targeting cells in a grand summary
cols_merge

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

Merge two columns to a value range column
extract_summary

Extract a summary list from a gt object
exibble

A toy example tibble for testing with gt: exibble
fmt_scientific

Format values to scientific notation
cell_fill

Helper for defining custom fills for table cells
fmt_passthrough

Format by simply passing data through
gtsave

Save a gt table as a file
opt_footnote_marks

Option to modify the set of footnote marks
fmt_number

Format numeric values
gtcars

Deluxe automobiles from the 2014-2017 period
tab_stubhead

Add label text to the stubhead
cols_width

Set the widths of columns
fmt_percent

Format values as a percentage
web_image

Helper function for adding an image from the web
html

Interpret input text as HTML-formatted text
fmt_markdown

Format Markdown text
md

Interpret input text as Markdown-formatted text
cell_text

Helper for defining custom text styles for table cells
cols_move

Move one or more columns
adjust_luminance

Adjust the luminance for a palette of colors
gt_preview

Preview a gt table object
opt_align_table_header

Option to align the table header
fmt_missing

Format missing values
opt_all_caps

Option to use all caps in select table locations
cells_body

Location helper for targeting data cells in the table body
random_id

Helper for creating a random id for a gt table
cols_move_to_start

Move one or more columns to the start
cells_column_labels

Location helper for targeting the column labels
opt_css

Option to add custom CSS for the table
opt_row_striping

Option to add or remove row striping
cols_align

Set the alignment of columns
currency

Supply a custom currency symbol to fmt_currency()
as.data.frame.gt_tbl

Transform a gt object to a data frame
cells_title

Location helper for targeting the table title and subtitle
info_google_fonts

View a table on recommended Google Fonts
cells_stub

Location helper for targeting cells in the table stub
gt

Create a gt table object
info_currencies

View a table with info on supported currencies
info_date_style

View a table with info on date styles
pizzaplace

A year of pizza sales from a pizza place
gt_latex_dependencies

Get the LaTeX dependencies required for a gt table
countrypops

Yearly populations of countries from 1960 to 2017
fmt_date

Format values as dates
cells_stubhead

Location helper for targeting the table stubhead cell
fmt

Set a column format with a formatter function
opt_table_font

Option to define a custom font for the table
opt_table_lines

Option to set table lines to different extents
test_image

Generate a path to a test image
text_transform

Perform targeted text transformation with a function
info_locales

View a table with info on supported locales
%>%

Pipe operator
fmt_datetime

Format values as date-times
cells_summary

Location helper for targeting group summary cells
render_gt

A gt display table render function for use in Shiny
row_group_order

Modify the ordering of any row groups
data_color

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

Merge two columns to a value & uncertainty column
tab_spanner_delim

Create column labels and spanners via delimited names
reexports

Objects exported from other packages
ggplot_image

Helper function for adding a ggplot
tab_style

Add custom styles to one or more cells
fmt_time

Format values as times
cols_move_to_end

Move one or more columns to the end
gt-options

gt package options
google_font

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

Add a table header
grand_summary_rows

Add grand summary rows using aggregation functions
fmt_currency

Format values as currencies
sza

Twice hourly solar zenith angles by month & latitude
print.gt_tbl

Print the table
summary_rows

Add groupwise summary rows using aggregation functions
tab_source_note

Add a source note citation
sp500

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

Add a row group to a gt table
gt-package

gt: Easily Create Presentation-Ready Display Tables
gt_output

Create a gt display table output element for Shiny
info_time_style

View a table with info on time styles
pct

Helper for providing a numeric value as percentage
px

Helper for providing a numeric value as pixels value
info_paletteer

View a table with info on color palettes
opt_table_outline

Option to wrap an outline around the entire table
tab_options

Modify the table output options
tab_spanner

Add a spanner column label
local_image

Helper function for adding a local image
tab_footnote

Add a table footnote
as_raw_html

Get the HTML content of a gt table