0

I run the exact same code in both shiny and shiny flexdashboard. The image can be inserted using shiny but failed for shiny flexdashboard. The image is stored in www folder and put in the same directory with the code file.

Does anyone know what the reason behind this would be?

shiny code:

  setwd("C:/Users/Desktop/Shiny dashboard")
  b=read.csv("table_clusterupdate.csv")

  shinyApp(
  ui = fluidPage(
   img(src="cluster.png", height = 500, width = 900),
   fluidPage(DT::dataTableOutput('tbl'))
   ),
   server = function(input, output) {output$tbl = DT::renderDataTable(
   b, options = list(lengthChange = FALSE)
   )
   })

Shiny flexdashboard code:

 ---
title: "R"
output: 
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---

```{r setup, include=FALSE}

setwd("C:/Users/Desktop/Shiny dashboard")
b=read.csv("table_clusterupdate.csv")

```
Multidimensional OP cluster 
===========================================
```{r}
shinyApp(
ui = fluidPage(

img(src="cluster.png", height = 500, width = 900),
fluidPage(DT::dataTableOutput('tbl'))
 ),
server = function(input, output) {output$tbl = DT::renderDataTable(
b, options = list(lengthChange = FALSE)
 )
 })
```
Matt
  • 7,255
  • 2
  • 12
  • 34

0 Answers0