notedown icon indicating copy to clipboard operation
notedown copied to clipboard

Support the Jupyter (IPython) R kernel

Open macd opened this issue 9 years ago • 7 comments

Project Jupyter now supports a R kernel (https://github.com/IRkernel/IRkernel) It would be nice to support this in translating Rmd to ipynb by removing the %%R magics in the cells and then adding the R specific metadata and language_info such as

"metadata": { "kernelspec": { "display_name": "R", "language": "", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "3.1.3" }

macd avatar May 30 '15 23:05 macd

Agreed, this would be good. I'd like to maintain compatibility with the %%R magic though.

Perhaps we could use the --rmagic flag to toggle the behavior, i.e. use the R kernel with

notedown input.Rmd --knit 

but use %%R with

notedown input.Rmd --knit --rmagic

aaren avatar May 31 '15 19:05 aaren

That sounds like a good plan. Thanks!

Don

On Sun, May 31, 2015 at 12:58 PM, aaren [email protected] wrote:

Agreed, this would be good. I'd like to maintain compatibility with the %%R magic though.

Perhaps we could use the --rmagic flag to toggle the behavior, i.e. use the R kernel with

notedown input.Rmd --knit

but use %%R with

notedown input.Rmd --knit --rmagic

— Reply to this email directly or view it on GitHub https://github.com/aaren/notedown/issues/24#issuecomment-107240313.

macd avatar May 31 '15 23:05 macd

On a similar point, will it support Julia code embedded in markdown?

sje30 avatar Sep 18 '15 16:09 sje30

@sje30 if I implement this it will be for the general case. If there is a Jupyter kernel written for the language then it should work.

aaren avatar Sep 24 '15 13:09 aaren

Todo list for this:

  • [x] install R kernel on my machine for testing (http://irkernel.github.io/installation/)
  • [ ] add a --kernel argument that defaults to python
  • [ ] set the language metadata when creating an internal notebook
    • [ ] kernelspec
    • [ ] language_info
  • [ ] check whether this kernel spec is used when using --run
  • [ ] allow setting metadata in a markdown yaml header?

aaren avatar Sep 24 '15 13:09 aaren

Great, let me know if you need help. There is a Julia kernel for Jupyter.

sje30 avatar Sep 24 '15 17:09 sje30

I'm probably not going to get around to this in the next couple of months unless I do some good procrastinating. Feel free to make a pull request in the meantime. The above list would be a good guideline.

aaren avatar Sep 24 '15 20:09 aaren