shiny
我在和中运行完全相同的代码shiny flexdashboard
。可以使用 插入图像,shiny
但失败shiny flexdashboard
. 图片存放在 www 文件夹中,并与代码文件放在同一目录下。
有谁知道这背后的原因是什么?
闪亮的代码:
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)
)
})
闪亮的 flexdashboard 代码:
---
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)
)
})
```