我是Shiny的新手。我正在仪表板上工作。我正在使用renderUI来获取一些输入。在两天的时间里,代码运行良好,但今天突然开始给我一些问题。任何帮助将不胜感激。
用户界面代码:
school.id
服务器代码:
localStorage
new_school_id
输出中的if语句使我空白,并给我一个错误,指出未找到ui <- fluidPage(
column(width =6,
box(width = NULL, status = "warning",solidHeader = TRUE,
title = "Topics Level",
selectInput(inputId = "Vis_level_select",
label = "",
selected = "Main Topics",
choices = c("Main Topics","Sub-Topics")
)
)
),
## Topic Number Output
column(width = 6,
box(width = NULL, status = "warning",solidHeader = TRUE,
title = "Select the topic for which Sub Topics are to be shown",
uiOutput("topic_no_select")
)
))
。一旦更改了server <- function(input, output){
## Topic number output
output$topic_no_select <- renderUI({
if(input$Vis_level_select == "Main Topics"){
selectInput(inputId = "main_topic_no", label = "", choices = "N/A", selected = "N/A")
} else{
selectInput(inputId = "main_topic_no", label = "", choices = c(1:10), selected = 1)
}
})
## LDAvis output
output$LDAvis_output <- renderVis({
if(input$Vis_level_select == "Sub-Topics"){
viz_file <- paste0("Viz_Sub_topics_Main_Topic_",input$main_topic_no)
} else if(input$Vis_level_select == "Main Topics"){
viz_file <- "Viz_Sub_topics_Main_Topics"
}
get(viz_file)
})
}
的值,那么LDAvis
的第一部分就可以使用,但是第二部分仍然不能使用。我不明白为什么会这样。
请告诉我这是否只是重新启动后将消失的错误。