Skip to content

corriebar/corrieaaR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

corrieaaR

A collection of function I frequently use. Use with care.

Installation

You can install the latest version of corrieaaR from Github with:

devtools::install_github("corriebar/corrieaaR")

Requirements

You'll need nbconvert and nbstripout which you can install as follows:

pip install nbconvert nbstripout

Convert jupyter notebook to Rmd

I build this package to be able to convert jupyter notebooks with Python code to an .Rmd file, in particular to then be used for a blogdown blog post. In your blogdown project, execute the following:

library(corrieaar)
notebook_file <- "path/to/awesome_notebook.ipynb"
new_post_from_ipynb(notebook_file)

This creates an .Rmd file in the content/post folder. Blogdown will then render the notebook first (that is, execute it) when you run serve_site()

blogdown::serve_site()

You can pass global chunk options and specify the Python version which reticulate should use:

new_post_from_ipynb(notebook_file, 
                    chunk_options = "echo=FALSE",
                    python_path = "path/to/your/bin/python")

To only convert to an .Rmd use the following:

Rmd_from_ipynb(notebook_file)

About

Collection of some R Functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages