Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


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

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

212,200

Version

0.6.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Iannone

Last Published

May 24th, 2022

Functions in gt (0.6.0)

cells_column_labels

Location helper for targeting the column labels
cell_borders

Helper for defining custom borders for table cells
as_raw_html

Get the HTML content of a gt table
as_latex

Output a gt object as LaTeX
cells_body

Location helper for targeting data cells in the table body
as_rtf

Output a gt object as RTF
cell_fill

Helper for defining custom fills for table cells
cell_text

Helper for defining custom text styles 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
cells_row_groups

Location helper for targeting row groups
cells_source_notes

Location helper for targeting the source notes
cells_stub_summary

Location helper for targeting the stub cells in a summary
cells_stubhead

Location helper for targeting the table stubhead cell
cols_label

Relabel one or more columns
cells_column_spanners

Location helper for targeting the column spanners
cols_merge_uncert

Merge columns to a value-with-uncertainty column
cells_footnotes

Location helper for targeting the footnotes
cols_align

Set the alignment of columns
cols_hide

Hide one or more columns
cells_grand_summary

Location helper for targeting cells in a grand summary
cols_move

Move one or more columns
data_color

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

Perform LaTeX escaping
default_fonts

A vector of default fonts for use with gt tables
exibble

A toy example tibble for testing with gt: exibble
cells_stub_grand_summary

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

Location helper for targeting cells in the table stub
cols_merge_n_pct

Merge two columns to combine counts and percentages
fmt

Set a column format with a formatter function
extract_summary

Extract a summary list from a gt object
fmt_currency

Format values as currencies
fmt_bytes

Format values as bytes
cols_merge_range

Merge two columns to a value range column
cols_move_to_end

Move one or more columns to the end
cols_merge

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

Supply a custom currency symbol to fmt_currency()
countrypops

Yearly populations of countries from 1960 to 2017
fmt_engineering

Format values to engineering notation
fmt_fraction

Format values as a mixed fractions
cells_group

Location helper for targeting row groups (deprecated)
fmt_number

Format numeric values
cols_move_to_start

Move one or more columns to the start
cells_summary

Location helper for targeting group summary cells
gt-options

gt package options
fmt_missing

Format missing values (deprecated)
fmt_date

Format values as dates
gt_latex_dependencies

Get the LaTeX dependencies required for a gt table
ggplot_image

Helper function for adding a ggplot
gt

Create a gt table object
opt_all_caps

Option to use all caps in select table locations
fmt_time

Format values as times
fmt_integer

Format values as integers
cols_unhide

Unhide one or more columns
cells_title

Location helper for targeting the table title and subtitle
cols_width

Set the widths of columns
google_font

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

Add grand summary rows using aggregation functions
opt_css

Option to add custom CSS for the table
info_time_style

View a table with info on time styles
info_paletteer

View a table with info on color palettes
gtsave

Save a gt table as a file
info_locales

View a table with info on supported locales
gtcars

Deluxe automobiles from the 2014-2017 period
info_google_fonts

View a table on recommended Google Fonts
info_date_style

View a table with info on date styles
gt-package

gt: Easily Create Presentation-Ready Display Tables
opt_footnote_marks

Option to modify the set of footnote marks
opt_horizontal_padding

Option to expand or contract horizontal padding
row_group_order

Modify the ordering of any row groups
sp500

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

Modify the table output options
tab_row_group

Add a row group to a gt table
local_image

Helper function for adding a local image
test_image

Generate a path to a test image
tab_style

Add custom styles to one or more cells
fmt_markdown

Format Markdown text
opt_row_striping

Option to add or remove row striping
opt_table_font

Option to define a custom font for the table
print.gt_tbl

Print the table
fmt_percent

Format values as a percentage
fmt_datetime

Format values as date-times
fmt_partsper

Format values as parts-per quantities
fmt_passthrough

Format by simply passing data through
html

Interpret input text as HTML-formatted text
fmt_scientific

Format values to scientific notation
md

Interpret input text as Markdown-formatted text
info_currencies

View a table with info on supported currencies
opt_align_table_header

Option to align the table header
opt_table_lines

Option to set table lines to different extents
opt_table_outline

Option to wrap an outline around the entire table
sub_large_vals

Substitute large values in the table body
%>%

Pipe operator
pizzaplace

A year of pizza sales from a pizza place
sub_missing

Substitute missing values in the table body
tab_stubhead

Add label text to the stubhead
tab_spanner_delim

Create column labels and spanners via delimited names
tab_footnote

Add a table footnote
tab_header

Add a table header
pct

Helper for providing a numeric value as percentage
gt_preview

Preview a gt table object
opt_vertical_padding

Option to expand or contract vertical padding
gt_output

Create a gt display table output element for Shiny
reexports

Objects exported from other packages
px

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

Print RTF text
text_transform

Perform targeted text transformation with a function
sub_small_vals

Substitute small values in the table body
sub_zero

Substitute zero values in the table body
render_gt

A gt display table render function for use in Shiny
web_image

Helper function for adding an image from the web
sza

Twice hourly solar zenith angles by month & latitude
summary_rows

Add groupwise summary rows using aggregation functions
random_id

Helper for creating a random id for a gt table
tab_source_note

Add a source note citation
tab_spanner

Add a spanner column label