sách gpt4 ai đã đi

Tập hợp con shinyTable

In lại 作者:行者123 更新时间:2023-12-02 03:38:16 27 4
mua khóa gpt4 Nike

我目前正在使用 shinyTable,它是 HandsonTable (https://github.com/trestletech/shinyTable) 的 shiny 兼容实现。巧合的是,我意识到,如果我将一个 logical 列添加到呈现的 dữ liệu.khung 中,这些值将显示为可点击的复选框。我希望使用它来轻松地对表进行子集化:

nhập mô tả hình ảnh ở đây

library(devtools)
# those versions are necessary to let shinyTable work with shiny
install_github( "shiny", "rstudio", ref="fcf963639e4839e5689665c257e7f488c9c34cc0" )
install_github( "shinyTable", "JackStat" )
library(shiny)
library(shinyTable)

runApp(list(
ui = bootstrapPage(
htable( "tbl", clickId="tblClick", headers="provided")
),
server = function(input, output) {
output$tbl <- renderHtable({
if( is.null( input$tbl ) ){
return( data.frame( select = TRUE, value = 1:10 ) )
} else{
return( input$tbl[ input$tbl$select, ] )
}
})
}
))

但是,当取消选中复选框时,我会得到以下结果:

nhập mô tả hình ảnh ở đây

有没有人对 shinyTable 有经验,可以给我一个如何避免这种情况的建议?

hoặc:

任何其他(对我的用户来说舒适)让我创建子集表的方法?

1 Câu trả lời

在这种情况下,少即是多

library(shiny)
library(shinyTable)

runApp(list(
ui = bootstrapPage(
htable( "tbl", clickId="tblClick", headers="provided", readOnly = 'false')
),
server = function(input, output) {
output$tbl <- renderHtable({
if( is.null( input$tbl ) ){
return( data.frame( select = TRUE, value = 1:10 ) )
}
})

}

))

关于r - 子集 shinyTable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21910853/

27 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com