|RStudio Reticulated Python|
|Written by Kay Ewbank|
|Thursday, 11 October 2018|
The latest version of RStudio has improved support with a number of programming languages and platforms, including SQL, D3, Python, Stan, and C++. The Python support comes via a reticulate package that provides an interface to Python.
The package lets you reticulate Python code into R, creating a new breed of project that makes use of both languages. You can embed a Python session within an R process, meaning you can import Python modules and call their functions directly from R. RStudio v1.2 now has support for executing reticulated Python chunks within R Notebooks, and you can execute Python code line-by-line. Python objects all exist in a single persistent session so are usable across chunks just like R objects. R and Python objects are also shared across languages with conversions done automatically when required; Matplotlib plots can be displayed within both notebook and console execution modes; and you get code completion and inline help for Python.
The developers of RStudio aren't suggesting you move to RStudio for projects that are Python-only, but if you are using reticulated Python within an R project then RStudio provides a useful set of tools.
Away from Python, you can now create and preview D3 visualizations and embed them in R Notebooks. There's also improved support for SQL, so you can create, run and preview SQL query results. New testing tool support means you can run testthat and shinytest tests and view results. You can also view PowerPoint presentations in R Markdown. There's better integration with a number of packages, including the keyring package for storing passwords; and the Plumber package for converting existing R code to a web API using a handful of special one-line comments. You can also now run R scripts in the background, view progress and output, and collect results when complete.
or email your comment to: email@example.com