Knitting R HTML help documents with rgl examples

Viewed 107

knitr provides a neat function to compile R HTML help documents which contain evaluated examples embedded in the document. This is achieved with the knit_rd function, which has some simple input arguments

packageVersion('knitr')
[1] ‘1.12.3’

args(knit_rd)
function (pkg, links = tools::findHTMLlinks(), frame = TRUE)  

However, when the examples contain rgl code for interactive graphics these do not get embedded in the document (but I'd sure like them to be!). But I know it is possible to embed rgl into knitr documents, but I don't see an easy way to do this with knit_rd(). Is there a simple way to accomplish this?

Edit:

Here's a situation that I'm working on (BASH commands):

mkdir matlib-dir
cd matlib-dir
git clone https://github.com/philchalmers/matlib.git
Rscript -e "library('knitr');knit_rd('matlib')"

Of the various files generated documents like the vectors3d.html contain rgl code, but nothing really there because they have not been embedded.

1 Answers
Related