2016-08-08 2 views
0

나는 r 스크립트와 출력을 PDF 문서로 변환하고 시도하기 위해 this linkthis link을 참조했습니다. 나는 단어 (파일 이름/디렉토리에 대한 수용)에 의해 첫 번째 링크 단어의 지시를 따랐지만 오류 메시지가 나타납니다.knitr을 사용하여 pdf로 <br><br><br>

> # Create Pdf files 
> knit("TextMining.Rmd") 


processing file: TextMining.Rmd 
    |.........              | 14% 
    ordinary text without R code 

    |...................            | 29% 
label: setup (with options) 
List of 1 
$ include: logi FALSE 

    |............................          | 43% 
    ordinary text without R code 

    |.....................................       | 57% 
label: cars 
    |..............................................     | 71% 
    ordinary text without R code 

    |........................................................   | 86% 
label: pressure (with options) 
List of 1 
$ echo: logi FALSE 

    |.................................................................| 100% 
    ordinary text without R code 


output file: TextMining.md 

[1] "TextMining.md" 
> markdownToHTML('TextMining.md', 'TextMining.html', options=c("use_xhml")) 
> system("pandoc -s TextMining.html -o TextMining.pdf") 
pandoc.exe: Error producing PDF from TeX source. 
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) 
pdflatex: The memory dump file could not be found. 
pdflatex: Data: pdflatex.fmt 

Warning message: 
running command 'pandoc -s TextMining.html -o TextMining.pdf' had status 43 

이 문제를 해결할 수없는 것 같습니다. 과거에는 몇 년 전 R 스크립트 자체에 이러한 참조를 포함하지 않고 RMD 파일에 내 코드를 입력하게하는 코드를 발견했습니다. 그런 다음 니트 PDF 또는 출력을 생산하는 그 효과에 뭔가를 클릭합니다. 출력 생성을 처리하는 더 좋은 방법이라고 생각합니다. 내가 어떻게 그렇게 할 수 있는지 제안 해 주시겠습니까?

편집 : 결과 :

library(knitr); (f = system.file("examples", "knitr-minimal.Rnw", package = "knitr")); knit(f) 
Warning message: 
package ‘knitr’ was built under R version 3.2.5 
[1] "C:/Users/XYZ/Documents/R/win-library/3.2/knitr/examples/knitr-minimal.Rnw" 


processing file: C:/Users/XYZ/Documents/R/win-library/3.2/knitr/examples/knitr-minimal.Rnw 
    |.........              | 14% 
    ordinary text without R code 

    |...................            | 29% 
label: setup (with options) 
List of 2 
$ include: logi FALSE 
$ cache : logi FALSE 

    |............................          | 43% 
    ordinary text without R code 

    |.....................................       | 57% 
label: boring-random 
    |..............................................     | 71% 
    inline R code fragments 

    |........................................................   | 86% 
label: boring-plots (with options) 
List of 3 
$ fig.width : num 4 
$ fig.height: num 4 
$ out.width : chr ".4\\linewidth" 

    |.................................................................| 100% 
    ordinary text without R code 


output file: knitr-minimal.tex 

[1] "knitr-minimal.tex" 

편집 2

library(tools);texi2pdf("knitr-minimal.tex") 
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit) 
entering extended mode 
(knitr-minimal.tex 
LaTeX2e <2016/03/31> patch level 1 
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls" 
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg") 
("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def" 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty") 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))) 
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\framed\framed.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\alltt.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\mathpazo.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.sty" 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty") 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty") 
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.cfg")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\url\url.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty" 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty" 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\auxhook.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty") 
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def") 
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg") 
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\puenc.def")) 

Package hyperref Message: Driver (autodetected): hpdftex. 

("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def" 
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\upquote\upquote.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\textcomp.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1enc.def"))) 
No file knitr-minimal.aux. 
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1cmr.fd") 
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\t1pplx.fd") 
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii" 
[Loading MPS to PDF converter (version 2006.09.02).] 
) ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty" 
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty")) 
*geometry* driver: auto-detecting 
*geometry* detected driver: pdftex 

Package geometry Warning: The marginal notes overrun the paper. 
    Add 4.86812pt and more to the right margin. 

*geometry* verbose mode - [ preamble ] result: 
* driver: pdftex 
* paper: <default> 
* layout: <same size as paper> 
* layoutoffset:(h,v)=(0.0pt,0.0pt) 
* modes: 
* h-part:(L,W,R)=(71.13188pt, 472.03123pt, 71.13188pt) 
* v-part:(T,H,B)=(71.13188pt, 652.70622pt, 71.13188pt) 
* \paperwidth=614.295pt 
* \paperheight=794.96999pt 
* \textwidth=472.03123pt 
* \textheight=652.70622pt 
* \oddsidemargin=-1.1381pt 
* \evensidemargin=-1.1381pt 
* \topmargin=-38.1381pt 
* \headheight=12.0pt 
* \headsep=25.0pt 
* \topskip=10.0pt 
* \footskip=30.0pt 
* \marginparwidth=65.0pt 
* \marginparsep=11.0pt 
* \columnsep=10.0pt 
* \skip\footins=9.0pt plus 4.0pt minus 2.0pt 
* \hoffset=0.0pt 
* \voffset=0.0pt 
* \mag=1000 
* \@twocolumnfalse 
* \@twosidefalse 
* \@mparswitchfalse 
* \@reversemarginfalse 
* (1in=72.27pt=25.4mm, 1cm=28.453pt) 

("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty" 
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty")) 
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\ot1pplx.fd") 
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\omlzplm.fd") 
Sorry, but C:\PROGRA~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed. 

The log file hopefully contains the information to get MiKTeX going again: 

    C:/Users/XYZ/AppData/Local/MiKTeX/2.9/miktex/log/pdflatex.log 

You may want to visit the MiKTeX project page, if you need help. 
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, : 
    unable to run 'pdflatex' on 'knitr-minimal.tex' 
In addition: Warning message: 
running command '"pdflatex" -interaction=nonstopmode "knitr-minimal.tex"' had status 1 
+0

당신은 라이브러리 (knitr)'의 출력을 게시 할 수 없습니다; (f = system.file ("examples", "knitr-minimal.Rnw", package = "knitr"))); knit (f)'. 이것은'pdflatex'가 PATH에 올바르게 설치되었는지 테스트 할 것입니다. 나는 최근에 비슷한 발급자와 직면했다. 마침내 MikTex 휴대용이 문제를 해결했다 – OdeToMyFiddle

+0

업데이트 된 설명을 참조하십시오. – Freewill

+0

죄송합니다. 이전에'라이브러리 (tools); texi2pdf ("knitr-minimal.tex")'를 추가하는 것을 잊어서 죄송합니다. pdf로 변환 – OdeToMyFiddle

답변

0

난 당신이 사용하지만 어쩌면 아래 링크는 문제를 해결할 수있는 운영 체제를 모른다. 아마도 Miktex에 대한 허가를 확인하기 만하면됩니다. 또 다른 기회는 MikTex를 관리자로 실행하는 것입니다. 추가 힌트는 첨부 된 링크에서도 설명됩니다.

https://tex.stackexchange.com/questions/81739/the-memory-dump-file-could-not-be-found

+0

MikeTex와 pandoc은 이미 언급 한 첫 번째 링크에서 설명한대로 설치 했습니까? 그래서 내가 아는 한 당신은 .Rmd 파일에서 pdf 문서를 변환하기 위해 tex 편집기와 판도를 설치해야합니다. 이것은 또한 귀하의 첫 번째 링크에 설명되어 있습니다. – Tim91

+0

예, 앞서 언급 한대로 다양한 패키지 설치를 포함한 모든 지침을 따랐습니다. – Freewill