The pseudo command \SweaveInput{file.Rnw} is converted to a code
chunk header <<child='file.Rnw'>>=
.
Similarly \SweaveOpts{opt = value} is converted to a code chunk
opts_chunk$set(opt = value) with the chunk option include =
FALSE
; the options are automatically fixed in the same way as local chunk
options (explained below).
The Sweave package \usepackage{Sweave} in the preamble is removed
because it is not required.
Chunk options are updated if necessary: option values true
and
false
are changed to TRUE
and FALSE
respectively;
fig=TRUE
is removed because it is not necessary for knitr (plots
will be automatically generated); fig=FALSE
is changed to
fig.keep='none'
; the devices pdf/jpeg/png/eps/tikz=TRUE
are
converted to dev='pdf'/'jpeg'/'png'/'postscript'/'tikz'
;
pdf/jpeg/png/eps/tikz=FALSE
are removed;
results=tex/verbatim/hide
are changed to
results='asis'/'markup'/'hide'
; width/height
are changed to
fig.width/fig.height
; prefix.string
is changed to
fig.path
; print/term/prefix=TRUE/FALSE
are removed; most of the
character options (e.g. engine
and out.width
) are quoted;
keep.source=TRUE/FALSE
is changed to tidy=FALSE/TRUE
(note the
order of values).
If a line @
(it closes a chunk) directly follows a previous
@
, it is removed; if a line @
appears before a code chunk and
no chunk is before it, it is also removed, because knitr only uses one
@ after <<>>= by default (which is not the original Noweb
syntax but more natural).