kableExtra
Construct Complex Table with knitr::kable() + pipe.
Science Score: 59.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
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
6 of 51 committers (11.8%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.9%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Construct Complex Table with knitr::kable() + pipe.
Basic Info
- Host: GitHub
- Owner: haozhu233
- License: other
- Language: R
- Default Branch: master
- Homepage: https://haozhu233.github.io/kableExtra/
- Size: 21.4 MB
Statistics
- Stars: 721
- Watchers: 24
- Forks: 152
- Open Issues: 142
- Releases: 3
Topics
Metadata Files
README.md
kableExtra 
When we are talking about table generators in R, knitr's kable() function is usually a popular choice because of its ultimate simplicity. Unlike those powerful table rendering engines such as xtable, the philosophy behind knitr::kable() is to make it easy for programmers to use. Just as it claimed in its function description,
This is a very simple table generator. It is simple by design. It is not intended to replace any other R packages for making tables. - Yihui
However, the ultimate simplicity of kable() also brought troubles to some of us, especially for new R users, who may not have a lot of experience on generating tables in R. It is not rare to see people including experienced users asking questions like how to center/left-align a table on Stack Overflow. Also, for me personally, I found myself repeatedly parsing CSS into kable() for some very simple features like striped lines. For LaTeX, it's even worse since I'm almost Stack Overflow dependent for LaTeX... That's why this package kableExtra was created.
I hope with kableExtra, you can
- Use default base
kable()(Or a good alternative for markdown tables ispander::pander()) for all simple tables - Use
kable()withkableExtrato generate 90 % of complex/advanced/self-customized/beautiful tables in either HTML or LaTeX - Only have to mess with raw HTML/LaTeX in the last 10% cases where
kableExtracannot solve the problem
This package can load required LaTeX package automatically in vanilla R Markdown. For customized R Markdown templates, it is recommended to load related LaTeX packages manually.
Features
Pipable syntax
kableExtra is NOT a table generating package. It is a package that can "add features" to a kable() output using a syntax that every useR loves - the pipes %>%. We see similar approaches to deal with plots in packages like ggvis and plotly. There is no reason why we cannot use it with tables.
Unified functions for both HTML and PDF
Most functionalities in kableExtra can work in both HTML and PDF. In fact, as long as you specifies format in kable() (which can be set globally through option knitr.table.format), functions in this package will pick the right way to manipulate the table be themselves. As a result, if users want to left align the table, kable(...) %>% kable_styling(position = "left") will work in both HTML and PDF. Recently, we also introduced a new kbl() function acting as an alternative to kable but provides better documentation and format detection.
Install
```r install.packages("kableExtra")
For dev version
devtools::install_github("haozhu233/kableExtra") ```
Basic Usage
```r library(kableExtra) dt <- mtcars[1:5, 1:4]
HTML table
kbl(dt, caption = "Demo Table") %>% kablestyling(bootstrapoptions = "striped", fullwidth = F) %>% addheader_above(c(" ", "Group 1" = 2, "Group 2[note]" = 2)) %>% footnote(c("table footnote"))
LaTeX Table
kbl(dt, booktabs = T, caption = "Demo Table") %>% kablestyling(latexoptions = c("striped", "holdposition"), fullwidth = F) %>% addheaderabove(c(" ", "Group 1" = 2, "Group 2[note]" = 2)) %>% footnote(c("table footnote"))
```
Results

More Information
For more information, please check the package vignette.
- Create Awesome HTML Table with
knitr::kable()and kableExtra (中文) - Create Awesome LaTeX Table with
knitr::kable()and kableExtra
Acknowledgement
I would like to thank colleagues at Hebrew SeniorLife Marcus Institute for Aging Research and the Boston Pepper Center for their input. I also would like to appreciate the mentorship from Tom Travison (@tgt75) and all the efforts from the open source community, which help this package keep getting better.
Owner
- Name: Hao Zhu
- Login: haozhu233
- Kind: user
- Location: Boston, MA
- Company: Harvard Medical School
- Website: zhuhao.org
- Repositories: 127
- Profile: https://github.com/haozhu233
AI for science. Netbio.
GitHub Events
Total
- Issues event: 40
- Watch event: 31
- Delete event: 13
- Issue comment event: 104
- Push event: 50
- Pull request review event: 2
- Pull request review comment event: 3
- Pull request event: 40
- Fork event: 9
- Create event: 17
Last Year
- Issues event: 40
- Watch event: 31
- Delete event: 13
- Issue comment event: 104
- Push event: 50
- Pull request review event: 2
- Pull request review comment event: 3
- Pull request event: 40
- Fork event: 9
- Create event: 17
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Hao Zhu | h****3@g****m | 491 |
| Hao Zhu | h****u@h****u | 12 |
| Will Beasley | w****y@h****m | 12 |
| Bill Evans | B****l@8****m | 11 |
| Duncan Murdoch | m****n@g****m | 9 |
| Salzer | b****r@g****m | 8 |
| Samia | s****0@g****m | 6 |
| Dan Chaltiel | d****l@g****m | 5 |
| Vincent Arel-Bundock | v****k@u****a | 5 |
| jokorn | j****t@o****m | 5 |
| bsalzer | 3****r@u****m | 5 |
| antaldaniel | a****l@g****m | 5 |
| Kirill Müller | k****r@m****g | 3 |
| kbrevoort | k****n@b****m | 3 |
| Augusto Magalhães | a****e@o****m | 2 |
| Jiaxiang Li | a****g@f****m | 2 |
| Bill Evans | B****s@A****m | 2 |
| Salim B | s****m@p****e | 2 |
| Irene | 2****s@u****m | 2 |
| Cillian Berragan | c****n@g****m | 2 |
| Rob Shepherd | r****d@g****m | 1 |
| AC Craft | a****4@g****m | 1 |
| Alan Butler | r****r@u****v | 1 |
| Jakob Richter | c****e@j****e | 1 |
| Leo | l****n@h****m | 1 |
| Deependra Dhakal | d****d@g****m | 1 |
| Quôc Peyrot | 4****t@u****m | 1 |
| Adrien Le Guillou | a****u@g****m | 1 |
| Gregory Fiumara | g****g@g****m | 1 |
| Jebu | j****u@e****k | 1 |
| and 21 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 238
- Total pull requests: 96
- Average time to close issues: over 1 year
- Average time to close pull requests: about 2 months
- Total issue authors: 215
- Total pull request authors: 26
- Average comments per issue: 2.55
- Average comments per pull request: 0.97
- Merged pull requests: 68
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 27
- Pull requests: 34
- Average time to close issues: 16 days
- Average time to close pull requests: 3 days
- Issue authors: 25
- Pull request authors: 8
- Average comments per issue: 2.07
- Average comments per pull request: 0.44
- Merged pull requests: 19
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ujtwr (4)
- thmschk (3)
- HenrikEckermann (3)
- raffaem (2)
- zahlenzauber (2)
- turbanisch (2)
- onecare-business-intelligence (2)
- FelipeCarrillo (2)
- tomasrei (2)
- Chanelle280 (2)
- aipe (2)
- hnguyen19 (2)
- vincentarelbundock (2)
- englianhu (2)
- pdmayer (2)
Pull Request Authors
- dmurdoch (51)
- vincentarelbundock (10)
- r2evans (6)
- bd-karen-byron (4)
- haozhu233 (3)
- krlmlr (3)
- fjesser (2)
- sonicseamus (2)
- KJByron (2)
- RockfordMankiniUCSD (2)
- MichaelChirico (2)
- OscardR (1)
- ThierryO (1)
- jamarav (1)
- q-w-a (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- cran 91,997 last-month
- Total docker downloads: 107,000
-
Total dependent packages: 331
(may contain duplicates) -
Total dependent repositories: 1,327
(may contain duplicates) - Total versions: 36
- Total maintainers: 1
cran.r-project.org: kableExtra
Construct Complex Table with 'kable' and Pipe Syntax
- Homepage: http://haozhu233.github.io/kableExtra/
- Documentation: http://cran.r-project.org/web/packages/kableExtra/kableExtra.pdf
- License: MIT + file LICENSE
-
Latest release: 1.4.0
published about 2 years ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/haozhu233/kableExtra
- Documentation: https://pkg.go.dev/github.com/haozhu233/kableExtra#section-documentation
- License: other
-
Latest release: v1.4.0
published about 2 years ago
Rankings
proxy.golang.org: github.com/haozhu233/kableextra
- Documentation: https://pkg.go.dev/github.com/haozhu233/kableextra#section-documentation
- License: other
-
Latest release: v1.4.0
published about 2 years ago
Rankings
conda-forge.org: r-kableextra
- Homepage: http://haozhu233.github.io/kableExtra/, https://github.com/haozhu233/kableExtra
- License: MIT
-
Latest release: 1.3.4
published about 5 years ago
Rankings
Dependencies
- R >= 3.1.0 depends
- digest * imports
- glue * imports
- grDevices * imports
- graphics * imports
- htmltools * imports
- knitr >= 1.16 imports
- magrittr * imports
- rmarkdown >= 1.6.0 imports
- rstudioapi * imports
- rvest * imports
- scales * imports
- stats * imports
- stringr >= 1.0 imports
- svglite * imports
- tools * imports
- viridisLite * imports
- webshot * imports
- xml2 >= 1.1.1 imports
- formattable * suggests
- magick * suggests
- sparkline * suggests
- testthat * suggests
- actions/checkout v3 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
- r-lib/actions/setup-tinytex v2 composite