【问题标题】:Working with subdirectories with RMarkdown使用 RMarkdown 处理子目录
【发布时间】:2016-12-25 15:28:54
【问题描述】:

我正在编写一个降价文档,但我想整理我的文件夹,以便更轻松地为我的文档存储我所有的东西。

我有一些图像想要放入文档中,但它们存储在相对于 .RMD 文档的名为 Images 的子文件夹中。

我该如何设置,以免出现此错误:

pandoc: Could not fetch New%20file.png
New file.png: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
Execution halted

这是我的代码:

---
title: "Markdown Tutorial"
author: "Me"
date: "August 18, 2016"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, fig.path='Images/')
```

# Creating and Setting Your Document

To create your first markdown document, open up RStudio and clic on File > New File > R Markdown... 

![Creating a new Markdow](New file.png)

【问题讨论】:

    标签: r markdown rstudio r-markdown


    【解决方案1】:

    将完整路径放在你的 Rmarkdown 中:

    # Creating and Setting Your Document
    
    To create your first markdown document, open up RStudio and clic on File > New File > R Markdown... 
    
    ![Creating a new Markdow](Images/fig1.png)
    

    【讨论】:

    • 好的!我试过了,但没有用。只是因为我在文件夹名称中添加了一个斜杠。不要这样做:![Creating a new Markdow](/Images/fig1.png)
    • 对,你的工作目录已经设置好了,所以不需要前导斜杠。
    猜你喜欢
    • 1970-01-01
    • 2021-06-17
    • 2016-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多