Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

save_kable

Save kable to files


Description

Save kable to files

Usage

save_kable(
  x,
  file,
  bs_theme = "simplex",
  self_contained = TRUE,
  extra_dependencies = NULL,
  ...,
  latex_header_includes = NULL,
  keep_tex = FALSE,
  density = 300
)

Arguments

x

A piece of HTML code for tables, usually generated by kable and kableExtra

file

save to files. If the input table is in HTML and the output file ends with .png, .pdf and .jpeg, webshot will be used to do the conversion.

bs_theme

Which Bootstrap theme to use

self_contained

Will the files be self-contained?

extra_dependencies

Additional HTML dependencies. For example, list(

...

Additional variables being passed to webshot::webshot. This is for HTML only.

latex_header_includes

A character vector of extra LaTeX header stuff. Each element is a row. You can have things like c("\\\\usepackage{threeparttable}", "\\\\usepackage{icons}") You could probably add your language package here if you use non-English text in your table, such as \\\\usepackage[magyar]{babel}.

keep_tex

A T/F option to control if the latex file that is initially created should be kept. Default is FALSE.

density

density argument passed to magick if needed. Default is 300.

Examples

## Not run: 
library(kableExtra)

kable(mtcars[1:5, ], "html") %>%
  kable_styling("striped") %>%
  row_spec(1, color = "red") %>%
  save_kable("inst/test.pdf")

## End(Not run)

kableExtra

Construct Complex Table with 'kable' and Pipe Syntax

v1.3.4
MIT + file LICENSE
Authors
Hao Zhu [aut, cre] (<https://orcid.org/0000-0002-3386-6076>), Thomas Travison [ctb], Timothy Tsai [ctb], Will Beasley [ctb], Yihui Xie [ctb], GuangChuang Yu [ctb], Stéphane Laurent [ctb], Rob Shepherd [ctb], Yoni Sidi [ctb], Brian Salzer [ctb], George Gui [ctb], Yeliang Fan [ctb], Duncan Murdoch [ctb], Bill Evans [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.