Apparent bug in RMarkdown to beamer using gt

The following looks like a bug to me.

---
output: beamer_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{r}
library(gt)
library(janitor)
temp <- mtcars |> tabyl(vs,am)
temp
temp |> gt()
```

gives

! LaTeX Error: Environment longtable undefined.

Thanks for the report : this is bug on rmarkdown for beamer_presentation

I opened to track and fix for next release

As a workaround you can add manually the missing package required for gt

---
output: 
  beamer_presentation: default
header-includes: |
  % gt packages
  \usepackage{booktabs}
  \usepackage{caption}
  \usepackage{longtable}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{r}
library(gt)
library(janitor)
temp <- mtcars |> tabyl(vs,am)
temp
temp |> gt()
```

I got them from

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.