Last Release: 0.2-0 (18 Jul 2013)
This package provides a means of evaluating JavaScript code, creating JavaScript objects and calling JavaScript functions and methods from within R. This can work by embedding the JavaScript engine within an R session or by embedding R in an browser such as Firefox and being able to call R from JavaScript and call back to JavaScript from R.
The package is a thin R layer on top of the JavaScript API provided by the Mozilla implementation of JavaScript - SpiderMonkey.
The code is programmatically generated using the RGCCTranslationUnit and RGCCTUFFI packages and uses the Rffi package to implement the invocation of the C routines (rather than .C() and .Call()).
A second use of this package is to allow R programmers to utilize code written in JavaScript. Most JavaScript code is designed for Web pages and needs the DOM object to be of use. However, JavaScript is seeing increased use and people are writing libraries in JavaScript to do different things outside of the DOM.
At the very least, we can use this to emulate a Web browser and how it handles Web pages. We can download the HTML for a page and evaluate the JavaScript content to mimic how, for example, forms are processed by dynamic JavaScript code.