我想找到一个资源,允许我的 Shiny selectInput 函数根据我创建的类别标题展开/折叠。我已经搜索了一些引导程序资源,但还没有成功。请原谅我的最小工作示例,我承认可能有更有效的方法来提供 MWE。感谢您提供的任何建议。
library(shiny)
library(tidyverse)
#create a quick dataset to plot
schools <- as.data.frame(table(
c('Adams', 'Van Buren', 'Clinton', 'Douglas', 'Edwards',
'Franklin', 'Grant', 'Harrison', 'Ignatius', 'Justice',
'Kellogg', 'Lincoln'),
dnn = list("school")))
enrollment <- as.data.frame(table(
c(300, 305, 265, 400, 500, 450, 475, 900, 800, 850, 1200, 1500),
dnn = list("enrollment")))
schoolsDataframe <- schools %>%
bind_cols(enrollment) %>%
select(school, enrollment)
#define data elements for selectInput choices argument
elem <- c('Adams', 'Van Buren', 'Clinton', 'Douglas')
mid <- c('Edwards', 'Franklin', 'Grant')
high <- c('Harrison', …Run Code Online (Sandbox Code Playgroud)