Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a collection of knitr examples
TeX HTML Other
Branch: master
Failed to load latest commit information.
.gitignore add the RStudio project file
001-minimal.Rmd an example for yihui/knitr#1022
001-minimal.md an example for yihui/knitr#1022
002-minimal.Rnw use T1 font encoding to avoid possible weirdness like <> being weird …
002-minimal.tex changes due to 1) the naming scheme of figures has changed (always ch…
003-minimal.Rhtml use rawgit.com to display the html output
003-minimal.html some minor css changes
004-minimal.brew clarify the difference between brew and knitr's brew; closes #12
004-minimal.txt make
005-latex.Rtex library(knitr), in case users compile these examples with rmarkdown, …
005-latex.tex changes due to 1) the naming scheme of figures has changed (always ch…
006-minimal.Rrst library(knitr), in case users compile these examples with rmarkdown, …
006-minimal.rst changes due to 1) the naming scheme of figures has changed (always ch…
007-text-output.Rmd change deprecated formatR options and argument names
007-text-output.md change deprecated formatR options and argument names
008-outdec.Rnw add two examples about OutDec and ggplot2 geoms
008-outdec.tex removal of some blank lines due to the major change in yihui/knitr@2b…
009-slides.Rmd library(knitr), in case users compile these examples with rmarkdown, …
009-slides.md update cache
010-upload.Rmd library(knitr), in case users compile these examples with rmarkdown, …
010-upload.md update cache
011-conditional-eval.Rnw move examples from gists to this repos for better management
011-conditional-eval.tex removal of some blank lines due to the major change in yihui/knitr@2b…
012-line-breaks.Rmd library(knitr), in case users compile these examples with rmarkdown, …
012-line-breaks.md removal of some blank lines due to the major change in yihui/knitr@2b…
013-par.Rnw library(knitr), in case users compile these examples with rmarkdown, …
013-par.tex :: is syntax highlighted due to yihui/highr#3
014-sweave.Rnw library(knitr), in case users compile these examples with rmarkdown, …
014-sweave.tex removal of some blank lines due to the major change in yihui/knitr@2b…
015-listings.Rnw library(knitr), in case users compile these examples with rmarkdown, …
015-listings.tex removal of some blank lines due to the major change in yihui/knitr@2b…
016-device.Rnw move examples from gists to this repos for better management
016-device.tex changes due to 1) the naming scheme of figures has changed (always ch…
017-auto-dependson.Rnw library(knitr), in case users compile these examples with rmarkdown, …
017-auto-dependson.tex library(knitr), in case users compile these examples with rmarkdown, …
018-fullfig-tikz.Rnw library(knitr), in case users compile these examples with rmarkdown, …
018-fullfig-tikz.tex remove cache, and re-make all examples (changes due to new figure nam…
019-fig-caption.Rnw library(knitr), in case users compile these examples with rmarkdown, …
019-fig-caption.tex changes due to yihui/knitr#746
020-for-loop.Rnw library(knitr), in case users compile these examples with rmarkdown, …
020-for-loop.tex removal of some blank lines due to the major change in yihui/knitr@2b…
020-for-template.rnw an example of a for loop
021-ggplot2-geoms.Rnw library(knitr), in case users compile these examples with rmarkdown, …
021-ggplot2-geoms.tex update 021 cache
022-nothing.Rmd indent the haiku to preserve line breaks
022-nothing.md indent the haiku to preserve line breaks
023-engine-python.Rmd test the new feature introduced in yihui/knitr#963
023-engine-python.md test the new feature introduced in yihui/knitr#963
024-engine-awk.Rmd the file option was deprecated now
024-engine-awk.md changes from knitr-manual.Rnw
025-engine-ruby.Rmd examples about awk, ruby and haskell
025-engine-ruby.md removal of some blank lines due to the major change in yihui/knitr@2b…
026-engine-haskell.Rmd use ghc for haskell
026-engine-haskell.md removal of some blank lines due to the major change in yihui/knitr@2b…
027-engine-bash.Rmd an example for bash scripts
027-engine-bash.md make
028-engine-perl.Rmd a Perl example for yihui/knitr#406
028-engine-perl.md removal of some blank lines due to the major change in yihui/knitr@2b…
029-engine-Rcpp.Rmd test the new feature introduced in yihui/knitr#963
029-engine-Rcpp.md test the new feature introduced in yihui/knitr#963
030-landscape.Rnw use kable() instead of xtable, and no 'tiny' argument
030-landscape.tex changes from Hmisc
031-noindent.Rnw library(knitr), in case users compile these examples with rmarkdown, …
031-noindent.tex library(knitr), in case users compile these examples with rmarkdown, …
032-persp.Rnw name and cache the persp chunk
032-persp.tex remove cache, and re-make all examples (changes due to new figure nam…
033-file-extension.Rnw library(knitr), in case users compile these examples with rmarkdown, …
033-file-extension.tex changes due to 1) the naming scheme of figures has changed (always ch…
034-chinese.Rhtml make strip
034-chinese.html some minor css changes
035-optipng.Rmd library(knitr), in case users compile these examples with rmarkdown, …
035-optipng.md remove cache, and re-make all examples (changes due to new figure nam…
036-latex-if.Rnw make strip
036-latex-if.tex removal of some blank lines due to the major change in yihui/knitr@2b…
037-graphics-hyperlink.Rnw library(knitr), in case users compile these examples with rmarkdown, …
037-graphics-hyperlink.tex remove cache, and re-make all examples (changes due to new figure nam…
038-output-width.Rnw should mention tidy=FALSE in the example
038-output-width.tex removal of some blank lines due to the major change in yihui/knitr@2b…
039-merge.Rmd the new chunk option `collapse`
039-merge.md removal of some blank lines due to the major change in yihui/knitr@2b…
040-grid-table.Rnw recompile after #43
040-grid-table.tex recompile after #43
041-label-i-child.tpl one solution to http://stackoverflow.com/q/12095113/559676
041-label-i.Rmd library(knitr), in case users compile these examples with rmarkdown, …
041-label-i.md changes due to 1) the naming scheme of figures has changed (always ch…
042-highlight-matlab.Rnw library(knitr), in case users compile these examples with rmarkdown, …
042-highlight-matlab.tex changes due to yihui/knitr#1028
043-percent.Rnw library(knitr), in case users compile these examples with rmarkdown, …
043-percent.tex removal of some blank lines due to the major change in yihui/knitr@2b…
044-size.Rnw library(knitr), in case users compile these examples with rmarkdown, …
044-size.tex removal of some blank lines due to the major change in yihui/knitr@2b…
045-chunk-hook.Rmd library(knitr), in case users compile these examples with rmarkdown, …
045-chunk-hook.md library(knitr), in case users compile these examples with rmarkdown, …
046-read-rforge.Rmd library(knitr), in case users compile these examples with rmarkdown, …
046-read-rforge.md remove cache, and re-make all examples (changes due to new figure nam…
047-tikz-png.Rnw library(knitr), in case users compile these examples with rmarkdown, …
047-tikz-png.tex remove cache, and re-make all examples (changes due to new figure nam…
048-cars-demo.Rnw use fontenc
048-cars-demo.tex changes due to 1) the naming scheme of figures has changed (always ch…
049-cars-demo.Rmd remove fig.align='center' from Rmd
049-cars-demo.md changes due to 1) the naming scheme of figures has changed (always ch…
050-allowframebreaks.Rnw run donttest
050-allowframebreaks.tex run donttest
051-flowchart.Rnw library(knitr), in case users compile these examples with rmarkdown, …
051-flowchart.tex remove cache, and re-make all examples (changes due to new figure nam…
052-suppress-output.Rmd library(knitr), in case users compile these examples with rmarkdown, …
052-suppress-output.md library(knitr), in case users compile these examples with rmarkdown, …
053-beamer-only.Rnw library(knitr), in case users compile these examples with rmarkdown, …
053-beamer-only.tex changes due to 1) the naming scheme of figures has changed (always ch…
054-loop-plots.Rmd draw plots inside a loop (http://stackoverflow.com/q/12935882/559676)
054-loop-plots.md changes due to 1) the naming scheme of figures has changed (always ch…
055-multicols.Rnw a multicols example for http://yihui.name/knitr/options#comment-69545…
055-multicols.tex changes due to 1) the naming scheme of figures has changed (always ch…
056-huge-plot.Rmd make
056-huge-plot.md remove cache, and re-make all examples (changes due to new figure nam…
057-engine-dot.Rmd cache the graphviz example
057-engine-dot.md remove cache, and re-make all examples (changes due to new figure nam…
058-engine-tikz.Rmd make
058-engine-tikz.md remove cache, and re-make all examples (changes due to new figure nam…
059-tikz.Rnw update the repo for tikzDevice
059-tikz.tex remove cache, and re-make all examples (changes due to new figure nam…
060-engine-sas.Rmd I've just added a '%' before "put", double quotes instead of single q…
060-engine-sas.md removal of some blank lines due to the major change in yihui/knitr@2b…
061-bash-variable.Rmd an example of bash variables being passed from R
061-bash-variable.md removal of some blank lines due to the major change in yihui/knitr@2b…
062-chunk-wrapper.Rmd library(knitr), in case users compile these examples with rmarkdown, …
062-chunk-wrapper.Rnw library(knitr), in case users compile these examples with rmarkdown, …
062-chunk-wrapper.md library(knitr), in case users compile these examples with rmarkdown, …
062-chunk-wrapper.tex library(knitr), in case users compile these examples with rmarkdown, …
063-html5-figure.Rmd library(knitr), in case users compile these examples with rmarkdown, …
063-html5-figure.md changes due to 1) the naming scheme of figures has changed (always ch…
064-bib-plot.Rnw use bibliography citations in plots (with tikzDevice)
064-bib-plot.tex changes due to 1) the naming scheme of figures has changed (always ch…
065-rmd-chunk.Rmd another way to write a literal code chunk
065-rmd-chunk.md another way to write a literal code chunk
066-listings-breaklines.Rnw library(knitr), in case users compile these examples with rmarkdown, …
066-listings-breaklines.tex removal of some blank lines due to the major change in yihui/knitr@2b…
067-graphics-options.Rnw library(knitr), in case users compile these examples with rmarkdown, …
067-graphics-options.tex changes due to yihui/knitr#746
068-beamer-simple.Rnw a minimal example of beamer
068-beamer-simple.tex changes due to 1) the naming scheme of figures has changed (always ch…
069-for-loop.Rnw library(knitr), in case users compile these examples with rmarkdown, …
069-for-loop.tex changes due to 1) the naming scheme of figures has changed (always ch…
069-for-template.rnw an example contributed by Gil Tomás: use for-loop to knit templates
070-caption-num.Rmd an example of figure numbers for http://stackoverflow.com/q/13848137/…
070-caption-num.md changes due to 1) the naming scheme of figures has changed (always ch…
071-cleveref-examples.Rnw library(knitr), in case users compile these examples with rmarkdown, …
071-cleveref-examples.tex removal of some blank lines due to the major change in yihui/knitr@2b…
072-latex-reference.Rnw library(knitr), in case users compile these examples with rmarkdown, …
072-latex-reference.tex changes due to yihui/knitr#746
073-code-appendix.Rnw library(knitr), in case users compile these examples with rmarkdown, …
073-code-appendix.tex library(knitr), in case users compile these examples with rmarkdown, …
074-example-environment.Rnw library(knitr), in case users compile these examples with rmarkdown, …
074-example-environment.tex removal of some blank lines due to the major change in yihui/knitr@2b…
075-knit-expand.Rnw library(knitr), in case users compile these examples with rmarkdown, …
075-knit-expand.tex removal of some blank lines due to the major change in yihui/knitr@2b…
075-template.rnw knit_expand(): a better template example than examples 020 and 041 (y…
076-chinese-gb2312.TEX removal of some blank lines due to the major change in yihui/knitr@2b…
076-chinese-gb2312.rnw how about inline R code containing chinese chars?
077-wrap-output.Rmd library(knitr), in case users compile these examples with rmarkdown, …
077-wrap-output.md library(knitr), in case users compile these examples with rmarkdown, …
078-chinese-big5.ctx removal of some blank lines due to the major change in yihui/knitr@2b…
078-chinese-big5.rnw update the big5 example; added a chunk tidy=FALSE and inline code
079-eval-echo.Rmd library(knitr), in case users compile these examples with rmarkdown, …
079-eval-echo.md library(knitr), in case users compile these examples with rmarkdown, …
080-engine-coffeescript.Rmd an example of evaluating coffee code instead of printing JavaScript (y…
080-engine-coffeescript.md an example of evaluating coffee code instead of printing JavaScript (y…
081-hello-chinese.lyx somehow there is a problem with ctex again; need to deal with \nobrea…
082-sweave-color.Rnw library(knitr), in case users compile these examples with rmarkdown, …
082-sweave-color.tex removal of some blank lines due to the major change in yihui/knitr@2b…
083-ggplot2-reference.Rmd suppress the message (I don't know why it appears on Travis but not o…
083-ggplot2-reference.md suppress the message (I don't know why it appears on Travis but not o…
084-pandoc-more.bib an example for the pandoc() function
084-pandoc.R rename the 'format' field to 't' (yihui/knitr#697)
084-pandoc.Rmd an example for the pandoc() function
084-pandoc.bib an example for the pandoc() function
084-pandoc.md changes due to 1) the naming scheme of figures has changed (always ch…
084-pandoc.pandoc rename the 'format' field to 't' (yihui/knitr#697)
085-pdfcrop.Rnw library(knitr), in case users compile these examples with rmarkdown, …
085-pdfcrop.tex remove cache, and re-make all examples (changes due to new figure nam…
086-xtable-examples.Rnw remove xtable comments
086-xtable-examples.tex removal of some blank lines due to the major change in yihui/knitr@2b…
087-child-example-child.rnw newlines at the end of files
087-child-example.Rnw newlines at the end of files
087-child-example.tex changes due to 1) the naming scheme of figures has changed (always ch…
088-pandoc-embedded.R an example for yihui/knitr#547
088-pandoc-embedded.Rmd rename format to t
088-pandoc-embedded.md changes due to 1) the naming scheme of figures has changed (always ch…
089-minimal.Rasciidoc add an asciidoc example for yihui/knitr#510
089-minimal.txt opts_knit$get('base.url') is now used in R AsciiDoc
090-engine-c.Rmd the C engine example
090-engine-c.md removal of some blank lines due to the major change in yihui/knitr@2b…
091-knitr-table.Rnw library(knitr), in case users compile these examples with rmarkdown, …
091-knitr-table.tex new lines added due to yihui/knitr#861
092-latex-rgl.Rnw hook_rgl was moved to the rgl package
092-latex-rgl.tex hook_rgl was moved to the rgl package
093-knitr-asy.Rmd library(knitr), in case users compile these examples with rmarkdown, …
093-knitr-asy.md remove cache, and re-make all examples (changes due to new figure nam…
094-purl.R changes due to yihui/knitr@f8c9726
094-purl.Rmd forgot to add an example for purl=FALSE
094-purl.md removal of some blank lines due to the major change in yihui/knitr@2b…
095-pandoc-header.Rmd an example of saving the chunk to a file
095-pandoc-header.md removal of some blank lines due to the major change in yihui/knitr@2b…
096-knit-exit.Rmd an example of knit_exit() (yihui/knitr#524)
096-knit-exit.md an example of knit_exit() (yihui/knitr#524)
097-Hmisc-scale.Rnw scale box applied to a table
097-Hmisc-scale.tex removal of some blank lines due to the major change in yihui/knitr@2b…
098-highlight-python.Rnw an example for #495
098-highlight-python.tex changes due to yihui/knitr#1028
100-alltt-verbatim.Rnw library(knitr), in case users compile these examples with rmarkdown, …
100-alltt-verbatim.tex library(knitr), in case users compile these examples with rmarkdown, …
101-cache-levels.Rmd the typo discovered in #32
101-cache-levels.md remove cache, and re-make all examples (changes due to new figure nam…
102-stitch-test.R add a chunk option to the stitch example
102-stitch.R examples for stitch()
103-move-float.Rnw an example for Michael Friendly: move code out of the floats
103-move-float.tex new lines added due to yihui/knitr#861
104-subfigure.Rnw an example for subfigure: http://stackoverflow.com/q/18724254/559676
104-subfigure.tex changes due to 1) the naming scheme of figures has changed (always ch…
105-minimal.Rtextile add a textile example for yihui/knitr#623
105-minimal.textile changes due to 1) the naming scheme of figures has changed (always ch…
106-polyglot.Rmd get rid of the paths of runtimes in the output; write them in message…
106-polyglot.md removal of some blank lines due to the major change in yihui/knitr@2b…
107-inline-linebreak.Rmd example for inline expression spanning several lines
107-inline-linebreak.md example for inline expression spanning several lines
108-animation-scianimator.Rmd there is already a 107; rename to 108
108-animation-scianimator.md changes due to yihui/knitr#1014
109-longstrings.Rnw rename the longstring example, and tweaked it
109-longstrings.tex removal of some blank lines due to the major change in yihui/knitr@2b…
110-rmarkdown-landscape.Rmd landscape PDF
110-rmarkdown-landscape.md landscape PDF
111-engine-fortran.Rmd no timing, otherwise it brings bogus diff in git
111-engine-fortran.md no timing, otherwise it brings bogus diff in git
112-yaml-in-child-child.rmd bugfix
112-yaml-in-child.Rmd RStudio -> rmarkdown
112-yaml-in-child.md the correct output for #36 after fixing yihui/knitr#862
113-externalization.Rmd add a quick example for http://yihui.name/knitr/demo/externalization/
113-externalization.md add a quick example for http://yihui.name/knitr/demo/externalization/
113-foo.R add a quick example for http://yihui.name/knitr/demo/externalization/
114-load-cache.Rmd an example to illustrate load_cache() (yihui/knitr#868)
114-load-cache.md an example to illustrate load_cache() (yihui/knitr#868)
Makefile highlight has been whitelisted
R-packages add tikzDevice
k no need to set base.dir now; I have moved the repo to Dropbox
knitall an example to illustrate load_cache() (yihui/knitr#868)
knitr-examples.Rproj add the RStudio project file
readme.md update README

readme.md

knitr examples

This repository is a collection of knitr examples. It is both for my own test purpose and for other knitters to learn about this package.

For each input file, there is an output file, e.g. 001-minimal.Rmd corresponds to 001-minimal.md.

Integration tests

The examples can be checked automatically with Travis CI. To enable:

  • Fork this repository and knitr
  • Enable Travis CI for your knitrfork
  • In your knitr fork, create a branch with the same name as in your knitr-examples fork
    • You can also choose to work in master in both repositories

Now, each time you push to knitr, the examples are compiled and checked for differences with the expected result. Use this for major changes to knitr to avoid undesired side effects.

Something went wrong with that request. Please try again.