1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_image.R
\name{as_image}
\alias{as_image}
\title{Render the table as an format-independent image and use it in R Markdown}
\usage{
as_image(x, width = NULL, height = NULL, file = NULL, ...)
}
\arguments{
\item{x}{kable input. Either HTML or LaTeX}
\item{width}{Image width in inches. (1 inch = 2.54 cm)}
\item{height}{Image height in inches. (1 inch = 2.54 cm)}
\item{file}{By default, as_image saves to an temp file, which works for
normal R Markdown. However if you are using things like xaringan, which can't
be a standalone html, you can specify this file be the path you need, e.g.
\code{"img/something.png"}}
\item{...}{Additional arguments passed to save_kable.}
}
\description{
This function generates a temporary png file using \code{save_kable}
and then try to put it in an R Markdown document using
\code{knitr::include_graphics}.
}
\examples{
\dontrun{
library(kableExtra)
kable(mtcars, "latex", booktabs = T) \%>\%
kable_styling(latex_options = c("striped", "scale_down")) \%>\%
row_spec(1, color = "red") \%>\%
as_image()
}
}
|