我们需要在 R闪亮中创建一个分层下拉列表。该列表至少有 3 个级别。您能帮我确定正确的库吗?请参考下面的图片供您参考。目前我们正在使用下面的代码。但是我们在下拉列表中得到了不正确的列。
ui.R
library(shiny)
library(shinydashboard)
library(shinyTree)
shinyUI(
shiny::fluidPage(
h3('Countries '),
shinyTree("tree", checkbox = TRUE),
verbatimTextOutput("x")
)
)
server.R
library(shiny)
library(shinydashboard)
library(shinyTree)
library(treemap)
data(GNI2014)
head(GNI2014)
GNI2014$pathString <- paste("world",
GNI2014$continent,
GNI2014$country,
sep = "/")
population <- as.Node(GNI2014)
GL<-as.list(population)
shinyServer(function(input, output, session) {
output$tree <- renderTree({GL })
output$x<-renderPrint({input$tree})
})
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)