I have referenced this link and this link to try and convert the r script and output to a PDF document. I followed the directions in first link word by word (accommodating for file names/directory) but i get an error message.
> # 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
I can't seem to be able to resolve this issue. In the past, a few years ago I had found a code that made me input my code in an RMD file instead of including such referencing in the R script itself. I would then click on knit PDF or something to that effect to produce the output. I feel that is a better way to handle the output generating. Could you also suggest how I could make that happen?
EDIT: result:
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"
Edit 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