blob: f22e66c7bf1f2b4b7167898cf523b4f34efd19c4 [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 Zhu4b0c51e2017-08-01 15:21:07 -040037
38For a full package documentation, please visit the
39\href{http://haozhu233.github.io/kableExtra/}{package documentation site}
40for more information
Hao Zhu76281fe2017-07-03 19:33:09 -040041}
42\note{
43If you found a feature on the documentation site that is not available
44in the version of \code{kableExtra} you are using, try to install the pre-release
45version from github. You can do so by running
46\code{devtools::install_github("haozhu233/kableExtra")}.
47
48Also, note that This package can load required LaTeX package automatically in
49vanilla rmarkdown. For customized rmarkdown templates, it is recommended to
50load related LaTeX packages manually.
51}
52\section{Features}{
53
54\strong{Pipable syntax:} \code{kableExtra} is NOT a table generating package. It is a
55package that can "add features" to a \code{kable} output using a syntax
56that every useR loves - the \href{http://r4ds.had.co.nz/pipes.html}{pipe}.
57We see similar approaches to deal with plots in packages like \code{ggvis} and
58\code{plotly}. There is no reason why we cannot use it with tables.
59
60\strong{Unified functions for both HTML and PDF:} Most functionalities in
61\code{kableExtra} can work in both HTML and PDF. In fact, as long as you
62specifies format in \code{kable} (which can be set globally through option
63\code{knitr.table.format}), functions in this package will pick the right way
64to manipulate the table be themselves. As a result, if users want to left
65align the table, \code{kable_styling(kable(...), position = "left")} will work
66in both HTML and PDF.
67}
68
Hao Zhue10cfd32017-02-21 16:41:14 -050069\keyword{package}