I'm trying out the flair package within a markdown document, and I'm having trouble knitting a document as shown in the package's announcement page. Here's a basic .Rmd example using code from that page:
---
title: "test"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
library(readr)
library(flair)
baby_names <- read_delim("https://education.rstudio.com/blog/2020/05/flair/kellys_ca.txt", delim = " ")
```
```{r geoms, include=FALSE}
baby_names %>%
ggplot(aes(x = Year, y = Count, fill = Gender)) +
geom_col()
baby_names %>%
ggplot(aes(x = Year, y = Count, color = Gender)) +
geom_line()
```
```{r echo=FALSE}
decorate("geoms") %>%
flair("_col") %>%
flair("fill = ") %>%
flair("_line") %>%
flair("color = ")
```
This fails to knit, giving me this error:
Error in viewer(htmlFile) : could not find function "viewer" Calls: ... knit_print.default -> normal_print -> print -> print.with_flair
I have tried knitting without preview without success either. I'm not entirely certain where the "viewer" function is coming from, or why it's being utilized.
EDIT: Will keep it open for now, but it seems to be a bug: https://github.com/kbodwin/flair/issues/13