I would like include a wider table in a two column LaTeX article. This could be
achieved in LaTeX using \begin{table*} ... \end{table*}
instead of
\begin{table} ... \end{table}
. How can I tell the R packages kable or kableExtra to
achieve this?
The following produced the usual \begin{table}
:
library(kableExtra)
kable(head(cars, 1), format = "latex") %>%
kable_styling()
which produces:
#> \begin{table}[H]
#> \centering
#> \begin{tabular}{r|r}
#> \hline
#> speed & dist\\
#> \hline
#> 4 & 2\\
#> \hline
#> \end{tabular}
#> \end{table}
But what I want instead is the following:
#> \begin{table*}[H]
#> \centering
#> \begin{tabular}{r|r}
#> \hline
#> speed & dist\\
#> \hline
#> 4 & 2\\
#> \hline
#> \end{tabular}
#> \end{table*}
I am aware that I could use gsub
to hack the output, but wonder if there is
way to do it cleanly.
Created on 2018-05-05 by the reprex package (v0.2.0).
tabular
totable*
, and I am loosing the floating environment. – Zitella