Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible solution to running javascript inside R/knitr #11

Open
yixuan opened this issue Feb 3, 2015 · 1 comment
Open

Possible solution to running javascript inside R/knitr #11

yixuan opened this issue Feb 3, 2015 · 1 comment

Comments

@yixuan
Copy link

yixuan commented Feb 3, 2015

Just found the V8 package that could run javascript code inside R.

@yihui
Copy link
Owner

yihui commented Feb 3, 2015

Pull requests welcome :)

Here is what I'd do if I were to add this feature:

  1. Use ct$validate() to group lines of JS code into minimal complete blocks (similar idea to https://github.com/yihui/highr/blob/master/R/utils.R#L8-L23);
  2. ct$eval() code blocks one by one, and collect output;
  3. knitr:::wrap() the list of source code and output created from the previous step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants