0
votes

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

1

1 Answers

2
votes

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").