我正在尝试将具有以下YAML的RMarkdown文件嵌入我的Shiny应用程序中:
title: "Awesome RMarkdown learnr Tutorial"
output:
learnr::tutorial:
progressive: true
allow_skip: true
runtime: shiny_prerendered
我用这个块来做:
ui.R
uiOutput("rmarkdown")
server.R
output$rmarkdown <- renderUI({
HTML(markdown::markdownToHTML(knitr::knit('tutorial/awesome_learnr.Rmd', quiet = TRUE)))
})
但是,在本地运行Shiny App时出现以下错误:
Error: The shiny_prerendered_chunk function can only be called from within runtime: shiny_prerendered
那么,还有另一个Shiny函数适合Shiny_prerendered_chunk函数吗?