1
我希望能夠顯示一些內容,如果條件滿足,我真的很感謝一些幫助。我認爲我很漂亮,但需要提升。我希望能夠顯示:關於Tabpanel閃亮內容的條件
- 內容1,如果類(光圈$ ..)= 「數字」 _內容2,如果類(光圈$ ..)= 「因素」
這裏我的代碼洙遠:
library(shiny)
ui = navbarPage(
"TEST",
tabPanel("Iris data",
uiOutput("tabs"),
conditionalPanel(condition = "input.level==1",
helpText("content1")
),
conditionalPanel(condition = "input.level==5",
helpText("content2")
)
)
)
server = function(input, output, session) {
output$tabs = renderUI({
Tabs <- as.list(colnames(iris))
Tabs_type <- lapply(iris, function(x) class(x))
for (i in 0:length(Tabs)){
Tabs[i] = lapply(paste(Tabs[i], sep=" "),tabPanel, value = Tabs_type[[i]])
}
do.call(tabsetPanel, c(Tabs, id = "value"))
})
}
shinyApp(ui, server)
我不知道如何更改ID類(虹膜$ ......)
在此先感謝您的幫助
請看看我的答案爲[這個問題](https://stackoverflow.com/questions/44780197/shiny-how-to-use-observe-as-input-in-conditional-panel )。我希望這可以幫助 –
嘿,我看到了你的答案,但我似乎無法改變每個tabapanel的ID以便有條件! –