Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
574 views
in Technique[技术] by (71.8m points)

r - Why are my DT Tables not generating tabBox/tabPanel?

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 enter image description here Tab2 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}
tabBox(width=18, height = "500px" ,
       #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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...