Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/gtPublic

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

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

rstudio/gt

CRAN statusLicense: MITR-CMD-checkCodecov test coverage

Best PracticesThe project has reached a stable, usable state and is being actively developed.Monthly DownloadsTotal Downloads

Follow on BlueskyPosit Cloud

Discord

Contributor Covenant



With thegt package, anyone can make wonderful-looking tables usingtheR programming language. Thegt philosophy: we can constructa wide variety of useful tables with a cohesive set of table parts.These include thetable header, thestub, thecolumn labels andspanner column labels, thetable body, and thetable footer.

It all begins withtable data (be it a tibble or a data frame). Youthen decide how to compose yourgt table with the elements andformatting you need for the task at hand. Finally, the table is renderedby printing it at the console, including it in an R Markdown document,or exporting to a file usinggtsave(). Currently,gt supports theHTML,LaTeX, andRTF output formats.


Thegt package is designed to be both straightforward yet powerful.The emphasis is on simple functions for the everyday display tableneeds. Here is a brief example of how to usegt to create a tablefrom the includedsp500 dataset:

library(gt)# Define the start and end dates for the data rangestart_date<-"2010-06-07"end_date<-"2010-06-14"# Create a gt table based on preprocessed# `sp500` table datasp500|>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 bygt:countrypops,sza,gtcars,sp500,pizzaplace,exibble,towny,peeps,films,metro,gibraltar,constants,illness,reactions,photolysis,nuclides,rx_adsl, andrx_addv.


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

Beyond the functions shown in the simplesp500-based example, there are many functions available ingt for creating super-customized tables. Check out thedocumentation website to get started via introductory articles for makinggt tables. There's a handyReference section that has detailed help for every function in the package.

Documentation Site

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

Posit Cloud



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

One such place is inGitHub 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 thegt_packageDiscord server. This is a good option for asking about the development ofgt, pitching ideas that may become features, and sharing your table creations!

Discord Server

Finally, there is thegt-packageBluesky account. There you'll find posts aboutgt (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, discusssome ideas, engage with others, and much more!

INSTALLATION

Thegt package can be installed fromCRAN with:

install.packages("gt")

You can also choose to install the development version ofgt fromGitHub:

devtools::install_github("rstudio/gt")

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


Packages that use or extendgt

There are severalR packages that either usegt to generate tabular outputs or extendgt 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 acontributor code ofconduct.
Byparticipating in this project you agree to abide by its terms.

📄 License

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

© Posit Software, PBC.

🏛️ Governance

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



About

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

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors57


[8]ページ先頭

©2009-2025 Movatter.jp