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

Is the Rmd output a valid RMarkdown notebook? #421

Closed
choldgraf opened this issue Jan 22, 2020 · 3 comments
Closed

Is the Rmd output a valid RMarkdown notebook? #421

choldgraf opened this issue Jan 22, 2020 · 3 comments

Comments

@choldgraf
Copy link
Contributor

This might be an ill-posed question, but I am wondering whether the two-way conversion with RMarkdown formats totally matches the specification of RMarkdown notebooks. E.g., could I take any random RMarkdown notebook and use jupytext to convert it into a Jupyter Notebook, and vice versa? Are there any edge cases or pain points where this wouldn't work? This might be a nice goal for the RMd support, since that would effectively bridge the document formats of Jupyter Notebooks and R documents...

@mwouts
Copy link
Owner

mwouts commented Jan 22, 2020

Hello @choldgraf , well that's how Jupytext started... see issue #1 😄

I would say that the conversion works rather well, at least by the number of issues I am seeing here.

I think on this subject @grst may have more experience than me. He helped me a lot getting this started. He also has experience with the .nb.html format (R notebooks with outputs, the Rmd document is embedded inside). And he has practice of using both Jupyter and knitr to render the notebook, see his reportsrender project. So he'll better know about the edge cases - which I'd be willing to fix anyway!

@grst
Copy link
Contributor

grst commented Jan 23, 2020

Hi @choldgraf,

I actually use it in production for a while to write python notebooks in jupyter lab and generating HTML reports with rmarkdown and reticulate. (See also, as @mwouts already mentioned, the reportsrender project. Especially the section about executing the same Rmd file with both nbconvert/papermill and rmardown. )
Also I never had issues opening R Rmd files and executing them with the irkernel.

So far, everything works like a charm!
The only caveat is that jupyter cell magics don't work. The Rmd file will still be valid, though. The line containing the cell magic will just be commented out (and, therefore, might break the notebook when executing it with rmarkdown).

@mwouts
Copy link
Owner

mwouts commented Mar 8, 2020

Chris, I think we've answered your question here, so I'll close this issue. Still, feel free to reopen if there is something we did not answer!

@mwouts mwouts closed this as completed Mar 8, 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

3 participants