我是新手,并且正在尝试编写一个用户可以动态添加数据过滤器的应用程序(请参阅下面的代码).我认为insertUI和删除UI非常酷.但是,我有几个问题:
1) I cannot address dynamically generates input$ids (see filterId in the code, l. 36 and l. 58)
2) in updateCheckboxGroupInput (l. 62) checkboxes are not preselected.
3) I cannot select data rows using which() (l. 74)
4) The checkboxes are not displayed inside the column, but spread over the whole page.
Run Code Online (Sandbox Code Playgroud)
我非常感谢任何提示.
谢谢,Jordi
这里的代码:
library(shiny)
rowvalues <- function(col,data) {
as.list(unique(data[col]))
}
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
fluidRow(
column(6, actionButton('addFilter', 'Add filter')),
column(6, actionButton('removeFilter', 'Remove filter')),
offset = 6
), …Run Code Online (Sandbox Code Playgroud)