Closed andrewheiss closed 4 years ago
I was able to partially duplicate this error: Running it in R 4.0.0 and RStudio 1.2.5033, I don't get an error, but I also don't get any output without adding the knit_print.with_flair
line.
In R 3.6, it seems to work fine still.
I'll make a point to try to track down what changed in R 4.0, and possibly also RStudio 1.3., when I have time.
Thanks for calling this to my attention!
@kbodwin - thanks for this great package!
I encounter the same issue as described above with: R version 4.1.0 and RStudio Desktop 1.4.1717 - knitting fails with the same Error-message as above and rmarkdown::render()
produces an empty slide.
The workaround with adding knit_print.with_flair()
still works though 👍
Error in viewer()
:
! could not find function "viewer"
Execution halted
how should I do ,thanks.
In RStudio Preview (v1.3.957), using R 4.0.0, knitting a document with
flair()
in it causes an error:This only happens when using RStudio. Running
rmarkdown::render()
from the terminal works fine, which makes me think it's an issue either internal to RStudio (perhaps they changed something withrstudioapi::getSourceEditorContext()
and that is then preventing theviewer <- getOption('viewer')
line in theprint.with_flair()
function definition? I have no idea 🤣)A workaround is to manually include
knit_print.with_flair()
at the end of thedecorate() %>% flair()
pipeline to force knitr to not try to use RStudio's internal viewer panel.Here's a reproducible example:
This causes the error (only in RStudio; this knits fine from outside RStudio):
title: "Testing" output: html_document