【发布时间】:2018-07-17 07:25:44
【问题描述】:
如何根据数据渲染一个闪亮的盒子。 数据由用户上传,它可以有比这更多的数据,所以我必须创建 一个动态的盒子。 我正在运行以下代码,并且在控制台中创建了四个框,而不是在闪亮的网页中。 请看一下,谢谢。
代码
list_data <- list(c("AB","CD","EF","GH")) #data
ui <- dashboardPage(
dashboardHeader(title = "Text Mining"),
dashboardSidebar(
sidebarMenu(
menuItem("NLP Tree", tabName = "NLP")
)
),
dashboardBody(
tabItems(
tabItem(tabName = "NLP",
fluidRow(
tabBox(width = 12,height="500",
tabPanel("Sentences",
uiOutput("nlp_sentences_tree")
)
)
)
)
)
)
)
server <- function(input, output) {
output$nlp_sentences_tree <- renderUI({
for(i in list_data[[1]]){
print(box(width = 8,
i
)
)
}
})
}
shinyApp(ui = ui, server = server)
【问题讨论】:
标签: r shiny shinydashboard