0
我想从模块外部调用R闪亮模块与反应数据,我阅读教程,并知道'()'不应包含在callModule参数中数据。不过,我收到了一条错误消息: Warning: Error in as.vector: cannot coerce type 'closure' to vector of type 'list
之后。R闪亮模块:从父服务器调用反应数据
下面是模块的代码:
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
是来自服务器的数据框反应。