【发布时间】:2017-01-12 13:47:09
【问题描述】:
快速问题:如何使用/获取闪亮的 gvisTable 的选择?
我可以像这样使用 DT 包来实现这一点:
library(DT)
library(shiny)
server <- function(input, output) {
output$dt <- renderDataTable({
datatable(cbind(c(1,2,3,4,5),c(5,4,3,2,1)))
})
output$dtselect <- renderText({
input$dt_rows_selected
})
}
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
"Selected Rows from Datatable in Text Output"
),
mainPanel(dataTableOutput("dt"),
textOutput("dtselect"))
)
)
shinyApp(ui = ui, server = server)
是否可以使用 gvis 获得相同的选择?我用谷歌搜索了很多,但找不到有人用闪亮的方式复制相同的内容。
【问题讨论】:
-
看到here?否则请澄清您对选择的含义。
-
我的意思是行选择,从选定的行中获取行/列号
-
我仍然不清楚你在追求什么。请提供具有预期输出的可重现示例。
-
希望这个带有 DT 的例子能让它更清楚。