gt

Easily generate information-rich, publication-quality tables from R

https://github.com/rstudio/gt

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    4 of 55 committers (7.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.1%) to scientific vocabulary

Keywords

docx easy-to-use html latex r rtf summary-tables

Keywords from Contributors

pandoc literate-programming rmarkdown ropensci tidyverse unconf summary-statistics unconf17 instrumental-variable commonmark
Last synced: 6 months ago · JSON representation

Repository

Easily generate information-rich, publication-quality tables from R

Basic Info
  • Host: GitHub
  • Owner: rstudio
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage: https://gt.rstudio.com
  • Size: 292 MB
Statistics
  • Stars: 2,114
  • Watchers: 47
  • Forks: 219
  • Open Issues: 301
  • Releases: 0
Topics
docx easy-to-use html latex r rtf summary-tables
Created almost 8 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security

README.md

[![CRAN status](https://www.r-pkg.org/badges/version/gt)](https://CRAN.R-project.org/package=gt) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![R-CMD-check](https://github.com/rstudio/gt/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/gt/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/rstudio/gt/graph/badge.svg)](https://app.codecov.io/gh/rstudio/gt) [![Best Practices](https://bestpractices.coreinfrastructure.org/projects/5593/badge)](https://bestpractices.coreinfrastructure.org/projects/5593) [![The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Monthly Downloads](https://cranlogs.r-pkg.org/badges/gt)](https://CRAN.R-project.org/package=gt) [![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/gt)](https://CRAN.R-project.org/package=gt) [![Follow on Bluesky](https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=0285FF&label=Follow%20on&color=0285FF)](https://bsky.app/profile/gt-package.bsky.social) [![Posit Cloud](https://img.shields.io/badge/Posit%20Cloud-gt%20Test%20Drive-blue?style=social&logo=rstudio&logoColor=75AADB)](https://rstudio.cloud/project/779965) [![Discord](https://img.shields.io/discord/1086103944280952992?color=%237289da&label=Discord)](https://discord.com/invite/Ux7nrcXHVV) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)

With the gt package, anyone can make wonderful-looking tables using the R programming language. The gt philosophy: we can construct a wide variety of useful tables with a cohesive set of table parts. These include the table header, the stub, the column labels and spanner column labels, the table body, and the table footer.

It all begins with table data (be it a tibble or a data frame). You then decide how to compose your gt table with the elements and formatting you need for the task at hand. Finally, the table is rendered by printing it at the console, including it in an R Markdown document, or exporting to a file using gtsave(). Currently, gt supports the HTML, LaTeX, and RTF output formats.


The gt package is designed to be both straightforward yet powerful. The emphasis is on simple functions for the everyday display table needs. Here is a brief example of how to use gt to create a table from the included sp500 dataset:

``` r library(gt)

Define the start and end dates for the data range

startdate <- "2010-06-07" enddate <- "2010-06-14"

Create a gt table based on preprocessed

sp500 table data

sp500 |> dplyr::filter(date >= startdate & date <= enddate) |> dplyr::select(-adjclose) |> gt() |> tabheader( title = "S&P 500", subtitle = glue::glue("{startdate} to {enddate}") ) |> fmtcurrency() |> fmtdate(columns = date, datestyle = "wdmdayyear") |> fmt_number(columns = volume, suffixing = TRUE) ```


There are 18 datasets provided by gt: countrypops, sza, gtcars, sp500, pizzaplace, exibble, towny, peeps, films, metro, gibraltar, constants, illness, reactions, photolysis, nuclides, rx_adsl, and rx_addv.


All of this tabular data is great for experimenting with gts functions and we make extensive use of these datasets in our documentation.

Beyond the functions shown in the simple sp500-based example, there are many functions available in gt for creating super-customized tables. Check out the documentation website to get started via introductory articles for making gt tables. There's a handy Reference section that has detailed help for every function in the package.

Documentation Site

With the gt Test Drive, you can try gt in the Posit Cloud environment that features the RStudio IDE and a large collection of ready-to-run examples. Visit the publicly available Posit Cloud project and try out the package in your browser. There's no charge to use this platform and you'll learn a lot about what the package can do!

Posit Cloud



Let's talk about making tables with gt! There are a few locations where there is much potential for discussion.

One such place is in GitHub Discussions. This discussion board is especially great for Q&A, and many people have had their problems solved in there.

GitHub Discussions

Another fine venue for discussion is in the gt_package Discord server. This is a good option for asking about the development of gt, pitching ideas that may become features, and sharing your table creations!

Discord Server

Finally, there is the gt-package Bluesky account. There you'll find posts about gt (including sneak previews about in-development features) and other table-generation packages.

Follow on Bluesky

These are all great places to ask questions about how to use the package, discuss some ideas, engage with others, and much more!

INSTALLATION

The gt package can be installed from CRAN with:

r install.packages("gt")

You can also choose to install the development version of gt from GitHub:

r devtools::install_github("rstudio/gt")

If you encounter a bug, have usage questions, or want to share ideas to make this package better, please feel free to file an issue.


Packages that use or extend gt

There are several R packages that either use gt to generate tabular outputs or extend gt in amazing ways. Here is a short list of some of these great packages:


Code of Conduct

Please note that the gt project is released with a contributor code of conduct.
By participating in this project you agree to abide by its terms.

License

gt is licensed under the MIT license. See the LICENSE.md file for more details.

Posit Software, PBC.

Governance

This project is primarily maintained by Rich Iannone. Other authors may occasionally assist with some of these duties.



Owner

  • Name: RStudio
  • Login: rstudio
  • Kind: organization
  • Email: info@rstudio.org
  • Location: Boston, MA

GitHub Events

Total
  • Create event: 8
  • Commit comment event: 163
  • Release event: 1
  • Issues event: 89
  • Watch event: 109
  • Delete event: 2
  • Issue comment event: 163
  • Push event: 90
  • Pull request review comment event: 19
  • Pull request review event: 50
  • Pull request event: 64
  • Fork event: 21
Last Year
  • Create event: 8
  • Commit comment event: 163
  • Release event: 1
  • Issues event: 89
  • Watch event: 109
  • Delete event: 2
  • Issue comment event: 163
  • Push event: 90
  • Pull request review comment event: 19
  • Pull request review event: 50
  • Pull request event: 64
  • Fork event: 21

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 7,559
  • Total Committers: 55
  • Avg Commits per committer: 137.436
  • Development Distribution Score (DDS): 0.114
Past Year
  • Commits: 422
  • Committers: 19
  • Avg Commits per committer: 22.211
  • Development Distribution Score (DDS): 0.469
Top Committers
Name Email Commits
Richard Iannone r****e@m****m 6,695
olivroy o****1@h****m 444
Ellis Hughes e****s@g****m 100
kbrevoort k****n@b****m 46
Teun van den Brand t****d@g****m 30
Aaron Gullickson a****n@g****m 24
JooYoung Seo j****5@i****u 20
Joe Cheng j****e@r****m 16
Jon Harmon j****n@a****m 16
Maximilian Girlich m****h@m****m 16
Carlos Scheidegger c****r@r****m 16
Niels Bock nb@p****k 16
Alexandra Lauer 4****r 15
Stuart Lodge l****t@g****m 10
Shannon Haughton s****n@g****m 9
Michael Chirico c****m@g****m 9
Daniel Sjoberg d****g@g****m 7
Stefan Nygaard Hansen s****n@g****m 6
your name e****n@g****m 5
Michael McCarthy 5****g 4
Christophe Dervieux c****x@g****m 4
Magnus Dehli Vigeland m****v@m****o 3
Robrecht Cannoodt r****d@g****m 3
Christopher Kenny c****4@c****u 3
Barret Schloerke b****t@r****m 3
obsaditelnost g****b@d****e 3
dermirko g****b@d****e 2
Kenneth Brevoort k****t@K****l 2
Bill Denney w****y@h****m 2
Rebecca Butler r****5@m****u 2
and 25 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 540
  • Total pull requests: 508
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 10 days
  • Total issue authors: 315
  • Total pull request authors: 37
  • Average comments per issue: 1.48
  • Average comments per pull request: 1.09
  • Merged pull requests: 434
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 82
  • Pull requests: 105
  • Average time to close issues: 14 days
  • Average time to close pull requests: 4 days
  • Issue authors: 66
  • Pull request authors: 18
  • Average comments per issue: 0.52
  • Average comments per pull request: 1.3
  • Merged pull requests: 75
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rich-iannone (39)
  • olivroy (34)
  • bzkrouse (12)
  • ddsjoberg (11)
  • thebioengineer (6)
  • rjazwiec (6)
  • slodge (6)
  • shannonhaughton (6)
  • alex-lauer (6)
  • LukasWallrich (6)
  • kendonB (5)
  • szimmer (5)
  • AlbertRapp (5)
  • mine-cetinkaya-rundel (4)
  • daattali (4)
Pull Request Authors
  • olivroy (213)
  • rich-iannone (193)
  • thebioengineer (14)
  • kbrevoort (13)
  • teunbrand (11)
  • shannonhaughton (6)
  • AaronGullickson (6)
  • obsaditelnost (5)
  • MichaelChirico (4)
  • slodge (4)
  • magnusdv (4)
  • rkb965 (3)
  • jonthegeek (2)
  • mcanouil (2)
  • remlapmot (2)
Top Labels
Issue Labels
Type: ☹︎ Bug (263) Type: ★ Enhancement (170) Difficulty: [2] Intermediate (130) Priority: [3] High (122) Effort: [2] Medium (113) Effort: [3] High (105) Difficulty: [3] Advanced (83) Priority: [2] Medium (75) Type: ⁇ Question (57) Focus: HTML Output (50) Focus: LaTeX Output (44) Priority: ♨︎ Critical (24) Focus: Quarto (17) Focus: Pharma (17) Focus: Word Output (16) Type: ✎ Docs (14) Difficulty: [1] Novice (9) Focus: i18n (8) Good First Issue (5) Effort: [1] Low (4) Focus: Accessibility (2) Type: ٩(͡๏̯͡๏)۶ Refactor (2) Priority: [1] Low (1) Help Wanted ㋡ (1) Blocked (╥﹏╥) (1)
Pull Request Labels
Focus: LaTeX Output (14) Focus: Quarto (7) Focus: Word Output (4) Focus: Accessibility (2)

Packages

  • Total packages: 3
  • Total downloads:
    • cran 213,296 last-month
  • Total docker downloads: 51,198
  • Total dependent packages: 86
    (may contain duplicates)
  • Total dependent repositories: 338
    (may contain duplicates)
  • Total versions: 41
  • Total maintainers: 1
cran.r-project.org: gt

Easily Create Presentation-Ready Display Tables

  • Versions: 16
  • Dependent Packages: 81
  • Dependent Repositories: 335
  • Downloads: 213,296 Last month
  • Docker Downloads: 51,198
Rankings
Stargazers count: 0.1%
Forks count: 0.3%
Dependent repos count: 0.9%
Dependent packages count: 1.2%
Downloads: 1.3%
Average: 3.8%
Docker downloads count: 19.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/rstudio/gt
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.0%
Average: 9.6%
Dependent repos count: 10.2%
Last synced: 6 months ago
conda-forge.org: r-gt
  • Versions: 10
  • Dependent Packages: 5
  • Dependent Repositories: 3
Rankings
Stargazers count: 9.7%
Dependent packages count: 10.4%
Average: 13.0%
Forks count: 13.9%
Dependent repos count: 17.9%
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.2.0 depends
  • base64enc >= 0.1 imports
  • bigD >= 0.2 imports
  • bitops >= 1.0 imports
  • cli >= 3.4.1 imports
  • commonmark >= 1.8 imports
  • dplyr >= 1.0.8 imports
  • fs >= 1.5.2 imports
  • ggplot2 >= 3.3.5 imports
  • glue >= 1.6.1 imports
  • htmltools >= 0.5.2 imports
  • htmlwidgets >= 1.6.1 imports
  • juicyjuice >= 0.1.0 imports
  • magrittr >= 2.0.2 imports
  • reactable >= 0.2.3 imports
  • rlang >= 1.0.2 imports
  • sass >= 0.4.1 imports
  • scales >= 1.2.0 imports
  • tibble >= 3.1.6 imports
  • tidyselect >= 1.1.1 imports
  • RColorBrewer * suggests
  • covr * suggests
  • digest >= 0.6.29 suggests
  • knitr * suggests
  • lubridate * suggests
  • paletteer * suggests
  • rmarkdown * suggests
  • rvest * suggests
  • shiny * suggests
  • testthat >= 3.0.0 suggests
  • tidyr * suggests
  • webshot2 * suggests
  • xml2 * suggests
.github/workflows/build-site.yaml actions
  • actions/checkout v3 composite
  • nwtgck/actions-netlify v2.0 composite
  • quarto-dev/quarto-actions/setup v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite