CHANGES IN knitr VERSION 1.10
NEW FEATURES
-
added a new chunk option
cache.rebuild
(default:FALSE
) to force knitr to invalidate and rebuild the cache for a chunk whencache.rebuild = TRUE
(thanks, @zachary-foster, #995) -
added a
stata
engine and improved the existingsas
engine (thanks, @Hemken #979, @muschellij2 #984) -
the Markdown table generated from
kable()
will use the width of characters to decide how many spaces are needed for padding, which can be useful for wide characters such as CJK characters (normally of width 2 per char) (thanks, @yutannihilation, #985) -
for language engines, the syntax of R Markdown code chunk headers can be
{lang, option=value}` now (e.g.
{python}and ````{Rcpp}
), which is equivalent to ````{r, engine='lang', option=value}` (thanks, @JanSchulz, #963) -
added the
...
argument toall_labels()
to make it possible to filter chunk labels according to local chunk options, e.g. you can useall_labels(engine == 'Rcpp')
to find the labels of all code chunks that have the chunk optionengine = 'Rcpp'
, and pass the character vector of labels toref.label
to gather allRcpp
code chunks into a single chunk -
added a new function
knit_params()
to extract report parameters from the YAML metadata of R Markdown documents; see?knit_params
for details (thanks, @jjallaire, #997) -
added support for code chunks inside Markdown blockquotes; see the example below (thanks, @r-gaia-cs, #1022)
> Here is a quote, followed by a code chunk: > > ```{r} > x = 1:10 > rev(x^2) > ```
-
the function
current_input()
gained a new argumentdir = FALSE
; whendir = TRUE
, the absolute path of the input document is returned (thanks, @klmr, #950) -
if you set
options(knitr.duplicate.label = 'allow')
before callingknit()
, duplicate labels will be allowed, and an incremental suffix will be appended to the duplicate label, e.g. when there are two non-empty chunks with the same labelfoo
, the second label may be converted tofoo-2
automatically; please use this feature only if you understand the consequences (e.g. the plot generated by a chunkfoo
might befoo-2-1.pdf
, which can be surprising) (thanks, @khughitt, #957) -
added a new language engine named
lein
to support Clojure (thanks, @kindlychung, #940)
MAJOR CHANGES
- the minimal required version of R is 3.0.2 now, and you are recommended to use the latest version of R when possible
BUG FIXES
- fixed #942: the package option
opts_knit$get('base.dir')
does not work when the chunk optionopts_chunk$get('fig.path')
contains a directory (thanks, @daattali and @cheebingloh) - fixed the bug reported at http://stackoverflow.com/q/28954647/559676 (
dev = 'png'
failed to work with rmarkdown when the output format ispdf_document
)