Heatmap on subtab in html

I try to create a heatmap on a subtap at a html site. On the first subtap it works pretty good, but if i copy the code to the second, third or ... subtab, the heatmap is not displayed on the html site. Is this a bug of RStudio or html? Or does anyone have an idea for this problem?

First Subtab {data-orientation=rows data-icon="fa-chart-line"}
=====================================

```{r}
matrix_data <- as.matrix(cbind(1200,300,50,3000,120,700,9))

k_plot <- plot_ly(
  x = c("MO", "DI", "MI", "DO", "FR", "SA", "SO"), y = c("0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"),
  z = matrix_data, type = "heatmap")
k_plot
```


Second Subtab {data-orientation=rows data-icon="fa-chart-line"}
=====================================

```{r}

##just a copy of First Subtab-Heatmap

matrix_data <- as.matrix(cbind(1200, 300, 50, 3000, 20,700,9))

k_plot <- plot_ly(
  x = c("MO", "DI", "MI", "DO", "FR", "SA", "SO"), y = c("0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"),
  z = matrix_data, type = "heatmap")
k_plot
```

When i knit this to flex_dashboard, the first subtab is displayed, but the second subtab is not displayed as shown in the screenshot.

I am currently in an apprenticeship, thanks for your help :slight_smile:

Edit: Here are some libray's that are used in the skript

#install.packages("flexdashboard")
#install.packages("plotly")
#install.packages("DT")
library(ggplot2)
library(dplyr)
library(reshape2)
library(plotly)
packageVersion('plotly')
library(maptools)
#library(DT)
library(flexdashboard)
library(data.table)
require(viridis)
#theme_set(
#  theme_void()
#  )

Hi,

it would help a lot if you could provide some code to reproduce.

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Hi, i hope the edits could help you to help me. :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.