r - 反应性闪亮对象类型闭包不可子集
问题描述
我无法弄清楚为什么我在这段代码中收到以下错误。我提前感谢任何想法。谢谢你。
警告:$ 中的错误:“闭包”类型的对象不是子集
Index_Percent <- reactive({input$IndexWeight})
TBA_Index_Data <- reactive({
left_join(TBAData_Gathered,Index_Weights)
TBA_Index_Data$Index_Percentage[TBA_Index_Data$cusip == "Cash"] <- Index_Percent()
})
解决方案
从您提供的代码来看,您似乎正试图在其内部加载一个反应函数。
正确的形式是这样的:
Index_Percent <- reactive({input$IndexWeight})
TBA_Index_Data <- reactive({
# these variables are reactive functions? if so, you need to add () as well.
table <- left_join(TBAData_Gathered,Index_Weights)
table$Index_Percentage[table$cusip == "Cash"] <- Index_Percent()
table
})
推荐阅读
- c# - LINQPad 缺少 Grpc 的 dll
- javascript - 如何在 JavaScript 中的对象中插入方法并调用它?
- excel - 在excel中为竞争对手反向链接分析数据集隔离根域的故障排除公式
- javascript - 如何使用来自 JSON 的数据使用 jQuery 显示解码的 html 文本
- python - 主题标签字符未正确显示
- node.js - 谷歌云控制台设置防火墙上的节点检查
- testing - 测试 Web 应用程序时在 JMeter 中获取未知主机异常
- html - 当浏览器响应时,强制第二个 Div 折叠在第一个 Div 之下
- python - 如何根据定义的日期范围为每个组创建更多行?
- android - 如何指定 URL 深层链接 android 清单