1
我从this question了解到,您可以将shinyApp选项设置为showcase mode
,以便在用户与应用程序交互时可视化(即突出显示)Shiny代码的哪些部分正在执行。如何在rmarkdown/knitr交互式Shiny文档中使展示模式工作?
但是,当我尝试将这个应用到使用knitr/R markdown的交互式Shiny文档时,展示的代码未能显示出来。
如何使showcase mode
在交互式文档中工作?
例子:
---
title: "Showcase Mode Doesn't Work in knitr"
output: html_document
runtime: shiny
---
See, look, no highlatable code shows up with the app:
```{r, echo=FALSE}
library(shiny)
ui <- fluidPage(
textInput(inputId = 'textin', label = ''),
textOutput(outputId = 'textout')
)
server <- function(input, output){
output$textout <- renderText({input$textin})
}
shinyApp(ui = ui, server = server, options = list(display.mode='showcase'))
```
http://rmarkdown.rstudio.com/authoring_shiny.html –
Hi @Petr。该文件的哪一部分回答了我的问题? – theforestecologist
@Petr我知道如何在rmarkdwon中嵌入应用程序。我的示例应用程序做得很好。但是,我无法将展示的代码显示在文档中。这个问题在您的链接中似乎没有得到解决。谢谢。 – theforestecologist