Really liking the look of gt so far and exploring it for an analysis. I'm attempting to knit regression tables generated by gt in an R Markdown document to PDF. I came across a (I think) bug where if the summary table has a variable called "(Intercept)", I get a knitting error. Removing the "(Intercept)" row allows the document to knit to PDF, and removing the ('s also allows the document to knit to PDF (i.e. replacing "(Intercept)" with "Intercept"). Not sure how to submit a reprex here since the error comes while knitting, but content of the .Rmd below. All three examples below work when knitting to HTML.
Working on gt version 0.1.0, tinytex 0.16
.Rmd file
---
title: "test"
author: "Dan"
date: "11/7/2019"
output:
pdf_document: default
html_document: default
bookdown::pdf_document2: default
---
```{r}
library(tidyverse)
library(broom)
library(gt)
Attempting to knit this chunk to PDF causes error "! Undefined control sequence."
mod <- lm(mpg ~ cyl, data = mtcars)
broom::tidy(mod) %>%
gt()
Works if I filter out the row with "(Intercept)" in it.
mod <- lm(mpg ~ cyl, data = mtcars)
broom::tidy(mod) %>%
filter(term != "(Intercept)") %>%
gt()
mod <- lm(mpg ~ cyl, data = mtcars)
broom::tidy(mod) %>%
mutate(term = ifelse(term == "(Intercept)","Intercept",term)) %>%
gt()
Really liking the look of gt so far and exploring it for an analysis. I'm attempting to knit regression tables generated by gt in an R Markdown document to PDF. I came across a (I think) bug where if the summary table has a variable called "(Intercept)", I get a knitting error. Removing the "(Intercept)" row allows the document to knit to PDF, and removing the ('s also allows the document to knit to PDF (i.e. replacing "(Intercept)" with "Intercept"). Not sure how to submit a reprex here since the error comes while knitting, but content of the .Rmd below. All three examples below work when knitting to HTML.
Working on gt version 0.1.0, tinytex 0.16
.RmdfileAttempting to knit this chunk to PDF causes error "! Undefined control sequence."
Works if I filter out the row with "(Intercept)" in it.