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
是來自服務器的數據框反應。