MLEN
MLEN

Reputation: 2561

kable_as_image knitr/kableextra rmarkdown

I am trying to use the function kable_as_image, which from my understanding will save the table as a image. My results though is not a table, dont know if I am doing something wrong as I cant find an example.

---
title: "Untitled"
author: "Test"
date: '2017-11-29'
output: pdf_document
---

```{r}
library(knitr)
library(kableExtra)
```

```{r}
kable_as_image(kable(head(iris)), filename = "~/Documents/.../.../pic")
```

#warning: kpathsea: gloss-$mainlang$.ldf: Unrecognized variable construct `$.'.

What my "picture" looks like:

enter image description here

Upvotes: 0

Views: 1352

Answers (1)

Hao
Hao

Reputation: 7856

Now I feel like kable_as_image is a somehow misleading name for the function. As explained in the doc, as least right now, it only works for latex tables, try kable_as_image(kable(..., format = "latex", booktabs = T), filename = "pic").

Upvotes: 2

Related Questions