Using the knitr Package

Switch to knitr

In the global options, and the Sweave section, switch over to compile with knitr. If you are inside a project, make sure to also do this for your project settings.

Take your sweaveHousing.Rnw or the homePrices.Rnw file and compile the PDF to see if it works! (In most cases, it should).

A Few Changes

Note that there are a few differences between Sweave and knitr

Also notice that every chunk statement needs to be a complete R command. For example, in Sweave, you could write results=hide, but in knitr, you need to add quotes to the string portion to make it results='hide'.

New Chunk Options

Take a look at the following chunk options for the knitr package on the knitr website. Yihui, the creator of knitr, outlines what each chunk option does.

http://yihui.name/knitr/options

Use these new options to do the following: