rpivotTable不适合我的Shiny Dashboard页面

Aks*_*hit 2 r shiny rpivottable

我在闪亮的仪表板中使用rpivoTable包.问题是我的表有近25个变量(列),而我只能查看10列.休息是不可见的,也没有滑块也可以查看它们.

最好,

Bat*_*hek 6

我找到一种方法 - 将css添加到该枢轴

tags$head(tags$style( type = 'text/css',  '#pivot{ overflow-x: scroll; }')),
          rpivotTableOutput('pivot', width = "100%", height = "500px")
Run Code Online (Sandbox Code Playgroud)

例如

UI

library(shiny)
library(rpivotTable)
library(shinydashboard)
shinyUI(dashboardPage(
  dashboardHeader(title = "example"),
  dashboardSidebar(disable = T),
  dashboardBody(

      tags$head(tags$style( type = 'text/css',  '#pivot{ overflow-x: scroll; }')),
      rpivotTableOutput('pivot', width = "100%", height = "500px")
  )

))
Run Code Online (Sandbox Code Playgroud)

服务器

df=data.frame(lapply(1:25,function(i)i=rnorm(20)))
colnames(df)=as.character(letters[1:25])

shinyServer(function(input, output,session) {

  output$pivot <- renderRpivotTable({
    rpivotTable(data = df)
  })


})
Run Code Online (Sandbox Code Playgroud)