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

xtable2kable

Convert xtable to a kable object


Description

This function allow users to turn an xtable object into a kable so they can use most of kableExtra's functions with their xtable code without making too many changes. Note that although I tested many cases and it seems to work, this function may not be functional in some other cases. I'm not a regular xtable user and can only provide very limited support for this function.

You should use this table in the same way as print.xtable. All the options you provided to this function will be sent to print.xtable. Instead of printing out the result, this function will return the LaTeX or HTML as text and a kable object.

Usage

xtable2kable(x, ...)

Arguments

x

an xtable object

...

options for print.xtable

Examples

## Not run: 
library(xtable)
xtable(mtcars) %>%
  xtable2kable(booktabs = TRUE) %>%
  kable_styling(latex_options = "striped")

## 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.