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

Define a standard between Jupyter and RStudio #1

Closed
mwouts opened this issue Jun 17, 2018 · 3 comments
Closed

Define a standard between Jupyter and RStudio #1

mwouts opened this issue Jun 17, 2018 · 3 comments

Comments

@mwouts
Copy link
Owner

mwouts commented Jun 17, 2018

R markdown and Jupyter notebooks are two formats for notebooks that target similar functionality. Unfortunately, in practice they don't overlap much, as

  • (R) markdown notebooks are edited within RStudio
  • Jupyter notebooks are edited within Jupyter

Imagine we could take the best from both worlds...

  • Markdown notebooks under version control are easier to merge
  • Markdown notebooks are lighter, since they don't store the output. That could solve Poor performance when saving a notebook over SSH jupyter/notebook#939
  • Markdown notebooks offer a very customizable rendering of code and outputs, and an impressive support for HTML slides
  • Jupyter notebooks include outputs, and could be a reference for R markdown notebooks with saved outputs
  • Jupyter notebooks reach a larger audience

Objective here is to collect feedback from RStudio and Jupyter projects on whether they deem valuable to improve the compatibility between the two environments.

@jmcphers
Copy link

Defining a shared notebook specification which serves the needs of users on both platforms while meeting the constraints laid out here is not impossible, but it's an ambitious undertaking!

Re: your last two bullet points, R Markdown notebooks can do this, too. If you save a notebook, a .nb.html file is generated. It's very Jupyter-like, a fully rendered HTML copy of the notebook, with outputs--and also embeds the original Rmd file. Using the .nb.html file to read outputs can give you the best of both worlds: version control on plain text, and a self-contained file with embedded outputs you can share or publish.

More on the R Notebook HTML format with embedded outputs here:

https://rmarkdown.rstudio.com/r_notebook_format.html

@mwouts
Copy link
Owner Author

mwouts commented Jun 28, 2018

Well, sure. A few more thoughts

  • R Markdown is by itself a great specification! What is missing is a standard way to translate Rmd chunk options into Jupyter cell metadata, which don't seem to be widely used.
  • Translating .Rmd to .ipynb works well with nbrmd. There are also a few alternative around: see https://github.com/aaren/notedown and https://github.com/grst/ipymd .
  • Getting a notebook to be fully executable with both Jupyter and RStudio works only to a certain extend. I expect it to work well if
    • notebook is 100% R
    • or 100% python, with no cell magics. Matplotlib plots are supported, but javascript plots are not yet working.

@mwouts mwouts closed this as completed Jun 28, 2018
@mwouts
Copy link
Owner Author

mwouts commented Oct 29, 2018

Hello @jmcphers, it has been a while since we discussed this. In the meantime I have made significant progress on my project, and I officially announced it one month ago. As you can see, the project was very well received by the community of Jupyter users, as people were missing the text notebook functionality.

The project now includes a few other notebooks formats, and we can now represent notebooks as Python or R (or Julia, etc) scripts. Obviously this is somehow related to knit::spin's format.

The point I would like to discuss now with you is the following: while R Markdown can accept any language, (and is indeed a great format for Python code as well), the fact that the code options have to be coded in R make it

  • difficult to adopt by non R users
  • and difficult to parse in other languages than R (think of Python or even Javascript, which is used by many editors, like Hydrogen or VScode).

Among the formats for notebooks as scripts (documented here), we now have two formats that are almost language agnostic. For simplicity the cell metadata are represented using JSON in these formats.

Now my question: do you think it would be feasible to design a flavor of the R Markdown format with code options represented in a non R format (say, JSON)?

mwouts added a commit that referenced this issue Feb 10, 2019
mwouts pushed a commit that referenced this issue Feb 10, 2019
mwouts added a commit that referenced this issue Feb 10, 2019
martinRenou added a commit to martinRenou/jupytext that referenced this issue Dec 1, 2020
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