Saya memiliki file penurunan harga R dasar ini:
---
title: 'test'
output:
html_document
---
![myimage](test.png)
File test.png
dapat ditemukan di folder proyek. Jika saya mengkompilasi dokumen pertama kali semuanya baik-baik saja:
|.................................................................| 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
Tetapi jika saya mengkompilasinya untuk kedua kalinya (tanpa mengubah apa pun) saya mendapatkan kesalahan ini:
|.................................................................| 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
Jika saya melihat ke folder proyek saya, gambar test.png
hilang. Dalam proses kompilasi pertama dokumen, gambar tersebut dihapus. Saya dapat mereproduksinya setiap saat. Dan tentu saja itu hilang untuk kompilasi kedua. Ini juga terjadi dengan .RData
file yang saya muat di dalam potongan R. Saya bahkan mencoba menyimpan file-file tersebut di folder terpisah dan menyalinnya setiap kali di dalam folder proyek saya, saya mengkompilasi dokumen saya (dengan perintah file.copy()
). Tapi kemudian file di folder luar juga hilang. Tampaknya setiap file yang disebutkan dalam dokumen penurunan harga akan dihapus atau dipindahkan ke tempat lain.
Apa yang saya temukan adalah ini terjadi hanya jika nama file penurunan harga mengandung spasi seperti test file.Rmd
. Halaman HTML yang dihasilkan dari file ini diformat test_file.html
jadi saya rasa terjadi beberapa transformasi menjadi nama file tanpa spasi.
Saya pikir ini adalah bug, saya harus melaporkan pada beberapa pelacak bug, tetapi karena saya tidak tahu apakah ini tentang rmarkdown, knitr, pandoc, RStudio atau yang lainnya, saya mempostingnya di sini.
Info sesi saya:
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