Add the examples to kable_as_image.R from https://haozhu233.github.io/kableExtra/save_kable_and_as_image.html, and update the help document.
diff --git a/R/kable_as_image.R b/R/kable_as_image.R
index ffe18be..b81d102 100644
--- a/R/kable_as_image.R
+++ b/R/kable_as_image.R
@@ -21,6 +21,20 @@
#' @param keep_tex A T/F option to control if the latex file that is initially created
#' should be kept. Default is `FALSE`.
#'
+#' @examples
+#' \dontrun{
+#' library(kableExtra)
+#'
+#' kable(mtcars[1:5, ], "html") %>%
+#' kable_styling("striped") %>%
+#' row_spec(1, color = "red") %>%
+#' save_kable("inst/test.pdf")
+#'
+#' kable(mtcars, "latex", booktabs = T) %>%
+#' kable_styling(latex_options = c("striped", "scale_down")) %>%
+#' row_spec(1, color = "red") %>%
+#' as_image()
+#' }
#' @export
kable_as_image <- function(kable_input, filename = NULL,
file_format = "png",
diff --git a/man/kable_as_image.Rd b/man/kable_as_image.Rd
index a10b331..e28247a 100644
--- a/man/kable_as_image.Rd
+++ b/man/kable_as_image.Rd
@@ -37,3 +37,18 @@
\description{
deprecated
}
+\examples{
+\dontrun{
+library(kableExtra)
+
+kable(mtcars[1:5, ], "html") \%>\%
+ kable_styling("striped") \%>\%
+ row_spec(1, color = "red") \%>\%
+ save_kable("inst/test.pdf")
+
+kable(mtcars, "latex", booktabs = T) \%>\%
+kable_styling(latex_options = c("striped", "scale_down")) \%>\%
+row_spec(1, color = "red") \%>\%
+as_image()
+}
+}