blob: e9446af73868d939285bb7a2f6ba6521959c50d5 [file] [log] [blame]
Hao Zhu73cf3732018-05-11 17:50:05 -04001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/save_kable.R
3\name{save_kable}
4\alias{save_kable}
5\title{Save kable to files}
6\usage{
Hao Zhu9410a272020-08-03 01:11:47 -04007save_kable(
8 x,
9 file,
10 bs_theme = "simplex",
11 self_contained = TRUE,
12 extra_dependencies = NULL,
13 ...,
14 latex_header_includes = NULL,
Hao Zhuab670942020-08-19 15:35:35 -040015 keep_tex = FALSE,
16 density = 300
Hao Zhu9410a272020-08-03 01:11:47 -040017)
Hao Zhu73cf3732018-05-11 17:50:05 -040018}
19\arguments{
20\item{x}{A piece of HTML code for tables, usually generated by kable and
21kableExtra}
22
Hao Zhu7f8b6842018-10-23 17:41:13 -040023\item{file}{save to files. If the input table is in HTML and the output file
24ends with \code{.png}, \code{.pdf} and \code{.jpeg}, \code{webshot} will be used to do the
Hao Zhu270846b2019-01-06 17:52:26 -050025conversion.}
Hao Zhu73cf3732018-05-11 17:50:05 -040026
27\item{bs_theme}{Which Bootstrap theme to use}
28
29\item{self_contained}{Will the files be self-contained?}
Hao Zhu7f8b6842018-10-23 17:41:13 -040030
Hao Zhu270846b2019-01-06 17:52:26 -050031\item{extra_dependencies}{Additional HTML dependencies. For example,
Hao Zhu9410a272020-08-03 01:11:47 -040032\verb{list(}}
Hao Zhu270846b2019-01-06 17:52:26 -050033
34\item{...}{Additional variables being passed to \code{webshot::webshot}. This
35is for HTML only.}
36
37\item{latex_header_includes}{A character vector of extra LaTeX header stuff.
38Each element is a row. You can have things like
Hao Zhu9410a272020-08-03 01:11:47 -040039\code{c("\\\\\\\\usepackage{threeparttable}", "\\\\\\\\usepackage{icons}")} You could
Hao Zhu270846b2019-01-06 17:52:26 -050040probably add your language package here if you use non-English text in your
Hao Zhu9410a272020-08-03 01:11:47 -040041table, such as \verb{\\\\\\\\usepackage[magyar]\{babel\}}.}
Hao Zhu270846b2019-01-06 17:52:26 -050042
43\item{keep_tex}{A T/F option to control if the latex file that is initially created
44should be kept. Default is \code{FALSE}.}
Hao Zhuab670942020-08-19 15:35:35 -040045
46\item{density}{density argument passed to magick if needed. Default is 300.}
Hao Zhu73cf3732018-05-11 17:50:05 -040047}
48\description{
49Save kable to files
50}
Hao Zhu9410a272020-08-03 01:11:47 -040051\examples{
52\dontrun{
53library(kableExtra)
54
55kable(mtcars[1:5, ], "html") \%>\%
56 kable_styling("striped") \%>\%
57 row_spec(1, color = "red") \%>\%
58 save_kable("inst/test.pdf")
59}
60}