ฉันมีไฟล์มาร์กดาวน์ R พื้นฐานนี้:
---
title: 'test'
output:
html_document
---
![myimage](test.png)
ไฟล์ test.png
สามารถพบได้ในโฟลเดอร์โครงการ ถ้าฉันรวบรวมเอกสารในครั้งแรกทุกอย่างก็ดี:
|.................................................................| 100%
ordinary text without R code
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS /Users/nf/test/test_file.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test_file.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/default.html --variable 'theme:bootstrap' --include-in-header /var/folders/x0/87l48swx73lg569_81cctqt00000gp/T//RtmpYYJgwp/rmarkdown-stree426f43954e.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --no-highlight --variable highlightjs=/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/highlight
processing file: test_file.Rmd
output file: /Users/nf/test/test_file.knit.md
Output created: test_file.html
แต่หากฉันคอมไพล์เป็นครั้งที่สอง (โดยไม่เปลี่ยนแปลงอะไรเลย) ฉันจะได้รับข้อผิดพลาดนี้:
|.................................................................| 100%
ordinary text without R code
processing file: test_file.Rmd
output file: /Users/nf/test/test_file.knit.md
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS /Users/nf/test/test_file.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test_file.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/default.html --variable 'theme:bootstrap' --include-in-header /var/folders/x0/87l48swx73lg569_81cctqt00000gp/T//RtmprFBDzb/rmarkdown-streef56b8e7e99.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --no-highlight --variable highlightjs=/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/highlight
pandoc: Could not fetch test.png
test.png: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
Execution halted
ถ้าฉันดูในโฟลเดอร์โปรเจ็กต์ของฉัน รูปภาพ test.png
จะหายไป ในกระบวนการรวบรวมเอกสารครั้งแรก รูปภาพจะถูกลบออกไป ฉันสามารถทำซ้ำได้ทุกครั้ง และแน่นอนว่ามันหายไปสำหรับการรวบรวมครั้งที่สอง สิ่งนี้ยังเกิดขึ้นกับ .RData
ไฟล์ที่ฉันโหลดภายใน R ชิ้น ฉันยังพยายามเก็บไฟล์ไว้ในโฟลเดอร์แยกต่างหากและคัดลอกมันทุกครั้งที่รวบรวมเอกสารในโฟลเดอร์โปรเจ็กต์ของฉัน (ด้วยคำสั่ง file.copy()
) แต่แล้วไฟล์ในโฟลเดอร์ภายนอกก็หายไปเช่นกัน ดูเหมือนว่าทุกไฟล์ที่กล่าวถึงในเอกสารมาร์กดาวน์จะถูกลบหรือย้ายไปที่อื่น
สิ่งที่ฉันพบคือสิ่งนี้จะเกิดขึ้นก็ต่อเมื่อชื่อของไฟล์มาร์กดาวน์มีช่องว่างเช่น test file.Rmd
หน้า Html ที่สร้างจากไฟล์นี้มีรูปแบบ test_file.html
ดังนั้นฉันเดาว่าจะมีการแปลงชื่อไฟล์โดยไม่มีช่องว่างเกิดขึ้น
ฉันคิดว่านี่เป็นจุดบกพร่องที่ฉันควรรายงานในตัวติดตามจุดบกพร่อง แต่เนื่องจากฉันไม่รู้ว่านี่เป็นเรื่องเกี่ยวกับ rmarkdown, knitr, pandoc, RStudio หรืออย่างอื่น ฉันจึงโพสต์ไว้ที่นี่
ข้อมูลเซสชันของฉัน:
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.2 (El Capitan)
locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.11
loaded via a namespace (and not attached):
[1] tools_3.2.2