R and Python Together using Reticulate

Created by Chia, Jonathan on Apr 09, 2022

Introduction

Reticulate lets you switch between Python and R in one R Markdown document

Notice that the python object flights was referenced in R using py$flights

Reticulate Setup Template:


Template.rmd

Strengths:


  1. You can code in Python and then switch to R for Shiny Dashboards

  2. You can pick and choose your favorite packages from either R or Python - ggplot vs seaborn, caret vs sklearn, etc.

  3. You can keep your R and python projects together in one place

  4. You can create beautiful R markdown reports that display both R and Python outputs

Weaknesses:


  1. Can feel a little clunky especially if you are used to Python IDE's

  2. Python objects do not show up in the R environment window - it will show up if our R server is updated to have newest RStudio

  3. You can use R in Jupyter Notebooks if you prefer Python

  4. You have to be reliant on the reticulate package to use Python

Additional Resources:

See below link for more information:

https://rstudio.github.io/reticulate/


Document generated by Confluence on Apr 09, 2022 16:54

Atlassian

Last updated