Skip to content

CHANGES IN knitr VERSION 1.10

Compare
Choose a tag to compare
@yihui yihui released this 25 Apr 02:00
· 2315 commits to master since this release

NEW FEATURES

  • added a new chunk option cache.rebuild (default: FALSE) to force knitr to invalidate and rebuild the cache for a chunk when cache.rebuild = TRUE (thanks, @zachary-foster, #995)

  • added a stata engine and improved the existing sas 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 to all_labels() to make it possible to filter chunk labels according to local chunk options, e.g. you can use all_labels(engine == 'Rcpp') to find the labels of all code chunks that have the chunk option engine = 'Rcpp', and pass the character vector of labels to ref.label to gather all Rcpp 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 argument dir = FALSE; when dir = TRUE, the absolute path of the input document is returned (thanks, @klmr, #950)

  • if you set options(knitr.duplicate.label = 'allow') before calling knit(), 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 label foo, the second label may be converted to foo-2 automatically; please use this feature only if you understand the consequences (e.g. the plot generated by a chunk foo might be foo-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