嗨給定的代碼使用代表字母和百分比列表的DT來生成基本表。我希望在DT表格中添加一個滑塊,以便當我將滑塊放置在特定百分比時,我會得到與該百分比及其以下相對應的行。謝謝,請幫助。實現動態滑塊來更新DT表百分比
## app.R ##
library(shiny)
library(shinydashboard)
library(DT)
library(scales)
ui <- fluidPage(
titlePanel("Basic datatable"),
# Create a new row for the table.
fluidRow(
DT::dataTableOutput("table")
)
)
server <- function(input, output) {
# Filter data based on selections
output$table <- DT::renderDataTable(DT::datatable({
a = percent(1:10)
b = c("aa","bbb","cc","dd","ee","ff","gg","ff","gg","hh")
data1 = data.frame(a,b)
data1
}))
}
shinyApp(ui, server)
謝謝薩加爾,感謝您的幫助。 –