change where rmarkdown saves images generated by r code

前端 未结 1 926
抹茶落季
抹茶落季 2021-01-01 00:10

I have a rmarkdown document and I\'m converting this file to md document. My problem is that I want the pictures created by plots to be placed in a folder called Images in t

相关标签:
1条回答
  • 2021-01-01 00:28

    Something like:

    ---
    title: "my test"
    author: "daniel"
    date: "18/08/2015"
    output:
      md_document
    ---
    
    <!-- README.md is generated from README.Rmd. Please edit that file -->
    
    ```{r opts, echo = FALSE}
    knitr::opts_chunk$set(
      fig.path = "images/"
    )
    ```
    

    will save all generated figures to the images sub-directory (and create said directory if it does not exist).

    0 讨论(0)
提交回复
热议问题