convert a jupyter notebook to R using jupytext and source it. Jupytext must be installed and available in the path

source_jupyter(
  file,
  outdir = NULL,
  jupytext_path = "jupytext",
  source_file = TRUE
)

Arguments

file

path to the jupyter notebook

outdir

directory to store the converted R file. By default the file would be created in the same directory as the jupyter notebook

jupytext_path

path to jupytext executable

source_file

if FALSE, and .R file is created but not sourced

Value

None

Examples

if (FALSE) {
# notebook.R is created in the same directory as notebook.ipynb
source_jupyter("notebook.ipynb")

# notebook.R is created in a temp directory
source_jupyter("notebook.ipynb", outdir = tempdir())
}