Question

I am trying to knit R Sweave files to .tex. When I knit the following document, the file knits fine:

\documentclass{article}

\begin{document}

Test

\end{document}

Here's the knit command:

knit(input="C:/Users/Isaac/Desktop/Test.Rnw", output="C:/Users/Isaac/Desktop/Test.tex")

When I knit the following document, however, I receive an error:

\documentclass{article}

\begin{document}

Test

<<sample, echo=FALSE>>=
N <- 65
@

\end{document}

Here's the error:

Warning in par("page") : "page" is not a graphical parameter
Quitting from lines 7-8 (C:/Users/Isaac/Desktop/Test.Rnw) 
Error in !par("page") : invalid argument type

This seemed to be working fine before I upgraded to knitr 1.50. Any ideas? I would like to include R chunks in the sweave file.

Was it helpful?

Solution

I thought CRAN would build binaries for each version of R separately, but it turns out that this is not the case. It builds the same Windows binary for all 3.0.x versions. The recommended solution for your problem is to upgrade to R 3.0.2; otherwise you have to install the evaluate package from source:

install.packages('evaluate', type = 'source')

The underlying problem is the evaluate package checks if page is in par() in the source code. Because CRAN uses R 3.0.2, this condition is true, whereas it is not the case in your version of R.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top