r - Rshiny:减少从所有组件的选定下拉列表中过滤 df 的处理时间
问题描述
我的仪表板有多个组件/图表,所有组件都将经历相同的过滤过程,并根据我的下拉选择选择正确的 df。有什么方法可以通过只对所有组件运行一次此过滤过程来减少该过程。
以下是过滤示例:
if(input$comp_region == "USA"){
txn_df <- usa_df
}else if(input$comp_region == "Australia"){
txn_df <- aus_df
}else{
txn_df <- jpn_df
}
txn_df <- txn_df %>%
filter(user_type %in% input$user) %>%
filter(date == input$time) %>%
解决方案
推荐阅读
- javascript - 无法从 PHP 和 Javascript 检索 JSON 值
- c - 调用外部接口时使用静态数组
- c++ - 为什么对齐限制会在矢量化时改变 clang 的行为?
- odoo - odoo 14如何实现基于记录的访问控制?
- javascript - 如何从具有 2 万个元素的数组中过滤自动完成数据?
- python-3.x - 如何运行返回变量的线程函数?
- java - Kafka 资源泄露
- kubernetes - 使用 Kubernetes 运行的服务的 API 网关?
- c - stat() 函数的最大文件名长度是否与操作系统接受的不同?
- google-apps-script - 为什么这个 getLastRow 语句不起作用?