Skip to content

ridhwanrazaliwork/Jupyter-Rmarkdown-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Jupyter Notebook to Rmarkdown converter

This notebook converts a Jupyter notebook (.ipynb, JSON) to an Rmarkdown (.Rmd) file.

How it works (high level):

  • Reads the notebook JSON into data. See Rmarkdown_convert.data.
  • Detects the notebook language from data["metadata"]["kernelspec"]["display_name"]. See Rmarkdown_convert.programming_language.
  • Extracts cells and iterates:
    • Markdown cells are appended as plain markdown.
    • Code cells are wrapped in fenced code blocks using the detected language.
  • Prepends a YAML header (yaml_config) and writes the final string (file_text) to converted_notebook.Rmd.
  • Output: a Rmarkdown file

Relevant file:

Reference

  1. https://towardsdatascience.com/how-to-convert-a-python-jupyter-notebook-into-an-rmarkdown-file-abf826bd36de/

About

To convert jupyter notebook to Rmarkdown

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors