3
试图采取这些想法更进一步:闪亮反应与IncludeMarkdown?
我想包括在输入一个mainPanel
条件的反应性降价文件(*.Md
)到selectInput
。我该怎么做?
我试过在renderText
,renderPrint
和使用eval
内includeMarkdown
变化。目前似乎没有任何工作。
EG。
### ui.R
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
selectInput("var1",
label= "Please Select option",
choices= c("option1", "option2", "option3"),
selected= "option1"
),
mainPanel(
h3("guide:")
includeMarkdown("md_file")
)
)
))
### server.R
shinyServer(function(input, output) {
output$md_file <-
if (input$var1 == "option1") {
renderPrint({"option1.Md"})
} else if (input$var1 == "option2") {
renderPrint({"option2.Md"})
} (input$var1 == "option3") {
renderPrint({"option3.Md"})
}
})
})
R> shiny::runApp('C:/Shiny_demo')
在readlines方法上侦听http://127.0.0.1:6421
警告(CON):
无法打开文件 'md_file':没有这样的文件或目录
错误readlines方法(CON):无法打开连接