【发布时间】:2018-01-10 02:14:03
【问题描述】:
我正在尝试使用来自模块外部的反应数据调用 R 闪亮模块,我阅读了教程并知道 '()' 不应该包含在反应数据的 callModule 参数中。但是我收到一条错误消息:
Warning: Error in as.vector: cannot coerce type 'closure' to vector of type
'list 之后。
这是模块的代码:
pieTableUI <- function(id, header, titleInfo, width = 6) {
ns <- NS(id)
infoClick <- h3(header,
tipify(
el = icon("info-circle"), trigger = "hover click",
title = titleInfo
))
tagList(
tabBox(
tabPanel("Pie Chart",
infoClick,
htmlOutput(ns("piechart"))),
tabPanel("Table",
infoClick,
htmlOutput(ns("table"))),
width = width
)
)
}
pieTable <- function(input, output, session, dataChart, x, y) {
output$piechart <- renderGvis({
gvisPieChart_HCSC(dataChart, x, y)
})
output$table <- renderGvis({
gvisTable(dataChart)
})
}
我调用了这个模块:
callModule(pieTable, "agegroupplot", dataChart = agegroup_data, x = "AGE_GROUP_CLEAN", y = "n")
agegroup_data 是来自服务器的响应式数据帧。
【问题讨论】: