2021年1月4日星期一

Tables in tabsetPanel not loading? R (Flexdashboard/Shiny)

This is a problem I can't seem to solve and I'm not sure why its happening.

My goal is to use the tabBox to put various tables in a single "flexdashboard area" and using {.tabset} is not an option. But it seems that when I start using tabPanels - only the first panel will generate my DT table and the second will not. The headers of the table are generating but I can't figure our why the actual data will not.

I'll be grateful for any help.

Here is what I see: Tab 1 is fine enter image description here

Tab 2 does not load at all but the columns do enter image description here

Here is my code

---  title: "Example Demo Dash"  output:     flexdashboard::flex_dashboard:      orientation: columns      vertical_layout: fill  runtime: shiny   ---      # Tab 1    ```{r setup, include=FALSE}  library(readr)  library(DT)  library(dplyr)  library(rsconnect)  require(flexdashboard)  library(shiny)  library(shinydashboard)  require(plotly)  ```    Column   -----------------------------------------------------------------------    ### Tab 1 Graph    # Tab 2    Column {data-width=450}  -----------------------------------------------------------------------    ### Cars Tab 1      ```{r}      cars <- datatable(mtcars,            rownames = FALSE,            options = list(              dom = 't',              paging = FALSE,              info = FALSE,              scrollY = FALSE,              sort = FALSE                      )  )       iris <- datatable(mtcars,            rownames = FALSE,            options = list(              dom = 't',              paging = FALSE,              info = FALSE,              scrollY = FALSE,              sort = FALSE                      )  )   ```    ```{r}  tabsetPanel(         #Dec 2020         tabPanel("Cars 1", cars),          #Jan 2021         tabPanel("Iris", iris))  ```      ### Col 2 Row 2      Column {data-width=200}  -----------------------------------------------------------------------    ### Tab 2 Col 2 Graph 1    ### Tab 2 Col 2 Graph 1    ### Tab 2 Col 2 Graph 3    ### Tab 2 Col 2 Graph 3    Column {data-width=350}  -----------------------------------------------------------------------  ### Col 3 graph 1    ### Col 3 graph 2    # tab 3  

Edit:Added package and R info

> packageVersion('flexdashboard')  [1] '0.5.2'  > version                 _                             platform       x86_64-w64-mingw32            arch           x86_64                        os             mingw32                       system         x86_64, mingw32               status                                       major          3                             minor          6.3                           year           2020                          month          02                            day            29                            svn rev        77875                         language       R                             version.string R version 3.6.3 (2020-02-29)  nickname       Holding the Windsock          >   
https://stackoverflow.com/questions/65570085/tables-in-tabsetpanel-not-loading-r-flexdashboard-shiny January 05, 2021 at 05:28AM

没有评论:

发表评论