簡體   English   中英

在r Shiny中顯示行名和同名

[英]display row names and colnames in r shiny

我想在我的儀表板中看到列的名稱。

在我的文件ui.R中,我嘗試將row.names=TRUE放入,但不起作用。

dashboardBody( 
      tabItems( tabItem(tabName="OP",(tableOutput("moyenne",rownames=TRUE)))))

並在我的文件中R:

shinyServer(function(input,output){

 output$moyenne <- renderTable({
 (moyenne)

})

謝謝

您想將renderTable rownames = TRUE傳遞給renderTable ,而不是tableOutput

library(shiny)

ui <- fluidPage(
  tableOutput("moyenne")
)

server <- function(input, output, session) {
  output$moyenne <- renderTable({
    moyenne
  }, rownames = TRUE)
}

shinyApp(ui, server)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM