【发布时间】:2017-09-11 07:30:21
【问题描述】:
请原谅不可重现的例子。理论上的解决方案就可以了。我想知道如何对存储在反应式表达式中的数据框进行子集化处理,以分配一个唯一的 output_id,并最终显示在 UI 中。这类似于访问数据框的列,如下所示:df$column_name
我使用eventReactive() 将数据帧存储为名为@987654322@ 的响应式表达式,该表达式与UI 中的actionButton() 链接。
环境中的代码:
# dataframe with n columns and k rows
df
用户界面:
actionButton(inputId = "go", label = "Update")
服务器:
# create a reactive expression 'data()', a subsetted data.frame based on other reactive values
data() <- eventReactive( input$go, { df %>% filter(based on other reactive values) } )
output$output_id <- renderSomething( { code depends on data()$specific column })
【问题讨论】:
标签: r shiny reactive-programming