blob: 33854bcf32d5dd68d1a7f18c65b8b93f64f7ecdd [file] [log] [blame]
Hao Zhue10cfd32017-02-21 16:41:14 -05001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/kableExtra-package.R
3\docType{package}
4\name{kableExtra-package}
5\alias{kableExtra-package}
6\alias{kableExtra}
7\title{kableExtra}
8\description{
Hao Zhu76281fe2017-07-03 19:33:09 -04009When we are talking about table generators in R,
10\href{https://yihui.name/knitr/}{knitr}'s \code{kable()} function wins lots of flavor
11by its ultimate simplicity. Unlike those powerful table rendering engines
12such as \href{https://CRAN.R-project.org/package=xtable}{xtable}, the philosophy
13behind \href{https://rdrr.io/cran/knitr/man/kable.html}{knitr::kable()} is to
14make it easy for programmers to use. Just as it claimed in its
15function description, "this is a very simple table generator. It is simple
16by design. It is not intended to replace any other R packages for making
17tables. - Yihui".
18
19However, the ultimate simplicity of \code{kable()} also brought troubles to some
20of us, especially for new R users, who may not have a lot of experience on
21generating tables in R. It is not rare to see people including experienced
22users asking questions like how to center/left-align a table on Stack
23Overflow. Also, for me personally, I found myself repeatedly parsing CSS
24into \code{kable()} for some very simple features like striped lines. For LaTeX,
25it's even worse since I'm almost Stack Overflow dependent for LaTeX...
26That's why this package \code{kableExtra} was created.
27
28I hope with \code{kableExtra}, you can
29\itemize{
30\item Use default base \code{kable()} (Or a good alternative for markdown tables is
31\code{pander::pander()}) for all simple tables
32\item Use \code{kable()} with \code{kableExtra} to generate 90 % of complex/advanced
33tables in either HTML or LaTeX
34\item Only have to mess with raw HTML/LaTeX in the last 10% cases where
35\code{kableExtra} cannot solve the problem
Hao Zhue10cfd32017-02-21 16:41:14 -050036}
Hao Zhu76281fe2017-07-03 19:33:09 -040037}
38\note{
39If you found a feature on the documentation site that is not available
40in the version of \code{kableExtra} you are using, try to install the pre-release
41version from github. You can do so by running
42\code{devtools::install_github("haozhu233/kableExtra")}.
43
44Also, note that This package can load required LaTeX package automatically in
45vanilla rmarkdown. For customized rmarkdown templates, it is recommended to
46load related LaTeX packages manually.
47}
48\section{Features}{
49
50\strong{Pipable syntax:} \code{kableExtra} is NOT a table generating package. It is a
51package that can "add features" to a \code{kable} output using a syntax
52that every useR loves - the \href{http://r4ds.had.co.nz/pipes.html}{pipe}.
53We see similar approaches to deal with plots in packages like \code{ggvis} and
54\code{plotly}. There is no reason why we cannot use it with tables.
55
56\strong{Unified functions for both HTML and PDF:} Most functionalities in
57\code{kableExtra} can work in both HTML and PDF. In fact, as long as you
58specifies format in \code{kable} (which can be set globally through option
59\code{knitr.table.format}), functions in this package will pick the right way
60to manipulate the table be themselves. As a result, if users want to left
61align the table, \code{kable_styling(kable(...), position = "left")} will work
62in both HTML and PDF.
63}
64
Hao Zhue10cfd32017-02-21 16:41:14 -050065\keyword{package}