Cannot create PDF from R Markdown without template file lines -


i trying create long document in r studio using r markdown pdf, , getting following error when push "knit pdf" button:

! undefined control sequence. l.124 \begin{center}\includegraphics  pandoc.exe: error producing pdf tex source error: pandoc document conversion failed error 43 in addition: there 50 or more warnings (use warnings() see first 50) execution halted 

i able create pdf if make new r markdown document , paste code in original, provided keep following code @ end of new document. when erase code, above error.

```{r, echo=false} plot(cars) ``` 

i have no need or desire cars plot in document. able knit document html without undesired code, not pdf. can advise why error may happening? (this first post forum, if need more specific information, please advise).

i running windows 7 32 bit, r studio version 0.98.1103, miktex version 2.9.

edit/update: here code, including cars graph not want.

--- title: "untitled" date: "saturday, april 25, 2015" output: pdf_document --- ```{r echo=false, warning=false, include=false}    require(qcc)    require(data.table)    require(ggplot2)    require(sm)    require(knitr)    require(xtable)    attach(airquality)    airquality$indicator <- ifelse(airquality$month < 8,'classic','new')  ```  ```{r echo=false, warning=false, results='hide', fig.align='center'}     par(mfrow=c(2,1), oma=c(1,1,1,1), cex=.5, mex=.5, ps=8, mgp=c(3,1,0))         airquality <- airquality[complete.cases(airquality),]      # plot variable on spc chart of type xbar.one     imrchart2 <- qcc(airquality$ozone[airquality$indicator=="classic"], "xbar.one", std.dev="sd", add.stats=true, ylab="ozone", title="xbar.one chart ozone", xlab="", data.name="classic", restore.par=false, newdata=airquality$ozone[airquality$indicator=="new"], newdata.name="new", ylim=range(airquality$ozone))     # plot cusum chart      cusum(airquality$ozone[airquality$indicator=="classic"], sizes=1, add.stats=true, ylab="ozone", title="cusum chart ozone", xlab="", restore.par=false, newdata=airquality$ozone[airquality$indicator=="new"], data.name="classic", newdata.name="new") ```  ```{r, echo=false} plot(cars) ``` 


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -