rmarkdown flexdashboard images 文件夹自行删除

rmarkdown flexdashboard images folder deletes itself

我的图像文件夹在第一次编织文档后自行删除。

我已经在 YAML header 中尝试 self_contained = TRUE,但没有用。

(我不确定这是否有所不同,但 Shiny 嵌入在仪表板中)

下面是我的代码:

---
title : app demo
author : yeshipants
output : 
  flexdashboard::flex_dashboard:
    orientation: rows
    self_contained : TRUE
    source_code: embed
runtime: shiny
---

```{r setup}
knitr::opts_chunk$set(cache = FALSE)
```
```{r loadPackages, cache = TRUE}  
setwd("C:/Users/user/Desktop/Training/OCR")
library(magick)
```
Column {.sidebar data-width=350}
-------------------------------------
### Input & Parameters
```{r inputImages, cache = TRUE}

selectInput("imagesToChoose", 
            label = "Choose an image to process",
            choices = c("Language example 1", 
                        "Language example 2",
                        "Jounal example"),
            selected = "Language example 1") 
```
Row {.tabset}
-------------------------------------  
### Original Image    
```{r displayImage, cache = FALSE}    
renderImage({      
  if (input$imagesToChoose == "Language example 1"){
    list(src = "images/receipt.png", height = 240, width = 300)
  }
  else if(input$imagesToChoose == "Language example 2"){
    list(src = "images/french.JPG", height = 240, width = 300)
  }
  else if(input$imagesToChoose == "Jounal example"){
    list(src = "images/journal.jpg", height = 240, width = 300)
  }    
})

```

我认为你必须这样做:

renderImage({      
  ......
}, deleteFile = FALSE)