Logo

0x3d.Site

is designed for aggregating information.
Welcome
check repository here

CRAN status License: MIT R-CMD-check Codecov test coverage

Best Practices The project has reached a stable, usable state and is being actively developed. Monthly Downloads Total Downloads

Twitter Follow Posit Cloud

Discord

Contributor Covenant



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:

library(gt)

# Define the start and end dates for the data range
start_date <- "2010-06-07"
end_date <- "2010-06-14"

# Create a gt table based on preprocessed
# `sp500` table data
sp500 |>
  dplyr::filter(date >= start_date & date <= end_date) |>
  dplyr::select(-adj_close) |>
  gt() |>
  tab_header(
    title = "S&P 500",
    subtitle = glue::glue("{start_date} to {end_date}")
  ) |>
  fmt_currency() |>
  fmt_date(columns = date, date_style = "wd_m_day_year") |>
  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 gt’s 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 X/Twitter account. There you'll find tweets about gt (including sneak previews about in-development features) and other table-generation packages.

Twitter Follow

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:

install.packages("gt")

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

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.



R Programming
R Programming
R is a programming language and software environment designed for statistical computing and graphics. It’s widely used in data analysis, machine learning, and academia, offering powerful tools for data visualization and modeling.
R Interface for Bokeh
R Interface for Bokeh
Read Excel Files
Read Excel Files
Arrow R Package
Arrow R Package
Export Data Frames to Excel xlsx Format
Export Data Frames to Excel xlsx Format
Visual Studio Code - Code Editing. Redefined
Visual Studio Code - Code Editing. Redefined
Manipulation of Microsoft Word and PowerPoint Documents
Manipulation of Microsoft Word and PowerPoint Documents
Functions for Tabular Reporting
Functions for Tabular Reporting
Dynamic Function-Oriented Make-Like Declarative Pipelines
Dynamic Function-Oriented Make-Like Declarative Pipelines
Bokeh documentation
Bokeh documentation
R - Visual Studio Marketplace
R - Visual Studio Marketplace
GitHub - Rcpp11/Rcpp11: R and C++11
GitHub - Rcpp11/Rcpp11: R and C++11
Data Apps for Production | Plotly
Data Apps for Production | Plotly
GitHub - tsieger/idendro: Interactive Dendrograms
GitHub - tsieger/idendro: Interactive Dendrograms
GitHub - datastorm-open/visNetwork: R package, using vis.js library for network visualization
GitHub - datastorm-open/visNetwork: R package, using vis.js library for network visualization
GitHub - Lchiffon/wordcloud2: R interface to wordcloud for data visualization.
GitHub - Lchiffon/wordcloud2: R interface to wordcloud for data visualization.
GitHub - REditorSupport/sublime-ide-r: R-IDE: Make Sublime Text a perfect IDE for R
GitHub - REditorSupport/sublime-ide-r: R-IDE: Make Sublime Text a perfect IDE for R
File not found · apache/mxnet
File not found · apache/mxnet
GitHub - sinhrks/ggfortify: Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages.
GitHub - sinhrks/ggfortify: Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages.
GitHub - RevolutionAnalytics/checkpoint: Install R packages from snapshots on checkpoint-server
GitHub - RevolutionAnalytics/checkpoint: Install R packages from snapshots on checkpoint-server
GitHub - wesm/feather: Feather: fast, interoperable binary data frame storage for Python, R, and more powered by Apache Arrow
GitHub - wesm/feather: Feather: fast, interoperable binary data frame storage for Python, R, and more powered by Apache Arrow
GitHub - kaneplusplus/bigmemory
GitHub - kaneplusplus/bigmemory
GitHub - IRkernel/IRkernel: R kernel for Jupyter
GitHub - IRkernel/IRkernel: R kernel for Jupyter
GitHub - yihui/animation: A gallery of animations in statistics and utilities to create animations
GitHub - yihui/animation: A gallery of animations in statistics and utilities to create animations
GitHub - rstudio/ggvis: Interactive grammar of graphics for R
GitHub - rstudio/ggvis: Interactive grammar of graphics for R
GitHub - nexr/RHive: RHive is an R extension facilitating distributed computing via Apache Hive.
GitHub - nexr/RHive: RHive is an R extension facilitating distributed computing via Apache Hive.
GitHub - textmate/r.tmbundle: TextMate support for R
GitHub - textmate/r.tmbundle: TextMate support for R
GitHub - renkun-ken/rlist: A Toolbox for Non-Tabular Data Manipulation
GitHub - renkun-ken/rlist: A Toolbox for Non-Tabular Data Manipulation
GitHub - clever-algorithms/CleverAlgorithmsMachineLearning: Defunct
GitHub - clever-algorithms/CleverAlgorithmsMachineLearning: Defunct
GitHub - boxuancui/DataExplorer: Automate Data Exploration and Treatment
GitHub - boxuancui/DataExplorer: Automate Data Exploration and Treatment
GitHub - talgalili/heatmaply: Interactive Heat Maps for R Using plotly
GitHub - talgalili/heatmaply: Interactive Heat Maps for R Using plotly
R Programming
More on R Programming

Programming Tips & Tricks

Code smarter, not harder—insider tips and tricks for developers.

Error Solutions

Turn frustration into progress—fix errors faster than ever.

Shortcuts

The art of speed—shortcuts to supercharge your workflow.
  1. Collections 😎
  2. Frequently Asked Question's 🤯

Tools

available to use.

Made with ❤️

to provide resources in various ares.