<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/use-python-functions-and-modules-in-r-with-the-reticulate-package/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2018/03/reticulate.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Since its inception over 40 years ago, when S (R's predecessor) was just a <a rel="nofollow" href="http://blog.revolutionanalytics.com/2014/07/reflections-on-john-chambers-userr-2014-keynote-address.html" target="_blank">sketch</a> on John Chambers' wall at Bell Labs, R has always been a language for providing interfaces. I was reminded of this during Dirk Eddelbuettel's <a rel="nofollow" href="http://dirk.eddelbuettel.com/papers/chirug_mar2018_extending.pdf" target="_blank">presentation</a> at the Chicago R User Group <a rel="nofollow" href="https://www.meetup.com/ChicagoRUG/events/248902857/" target="_blank">meetup</a> last night, where he enumerated Chambers' three principles behind its design (from his 2016 book, <a rel="nofollow" href="https://www.crcpress.com/Extending-R/Chambers/p/book/9781498775717" target="_blank">Extending R</a>):</p>
<ol>
<li><strong>Object:</strong> Everything that exists in R is an object</li>
<li><strong>Function</strong>: Everything that happens in R is a function call</li>
<li><strong>Interface</strong>: Interfaces to other software are a part of R</li>
</ol>
<p>The third principle &quot;Interface&quot; is demonstrated by R's broad connections to data sources, numerical and statistical computation libraries, graphical systems, external applications, and other languages. And it's further supported by the <a rel="nofollow" href="https://rstudio.github.io/reticulate/" target="_blank">formal announcement</a> this week of the <a rel="nofollow" href="https://rstudio.github.io/reticulate/" target="_blank">reticulate package</a> from RStudio, which provides a new interface between R and Python. With reticulate, you can:</p>
<ul>
<li>Import objects from Python, automatically converted into their equivalent R types. (For example, Pandas data frames become R data.frame objects, and NumPy arrays become R matrix objects.)</li>
<li>Import Python modules, and call their functions from R </li>
<li>Source Python scripts from R</li>
<li>Interactively run Python commands from the R command line</li>
<li>Combine R code and Python code (and output) in R Markdown documents, as shown in the snippet below</li>
</ul>
<p><a rel="nofollow" href="https://blog.rstudio.com/2018/03/26/reticulate-r-interface-to-python/" target="_blank"><img border="0" alt="Rmarkdown_engine_zoomed" title="Rmarkdown_engine_zoomed" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c95c9583970b-800wi"></a></p>
<p>The reticulate package was first released <a rel="nofollow" href="https://github.com/rstudio/reticulate" target="_blank">on Github</a> in January 2017, but has only been available on CRAN since last month. It has already spawned several higher-level integrations between R and Python-based systems, including:</p>
<ul>
<li><a rel="nofollow" href="https://blog.h2o.ai/2018/03/h2o4gpu-now-available-in-r/" target="_blank">H204GPU</a>, a R package for H20's GPU-based scikit-learn-like suite of algorithms;</li>
<li><a rel="nofollow" href="https://greta-dev.github.io/greta/" target="_blank">greta</a>, a packagefor Bayesian model estimation with Markov-chain Monte-carlo, based on Tensorflow</li>
<li><a rel="nofollow" href="https://github.com/quanteda/spacyr" target="_blank">spacyr</a>, a wrapper for the <a rel="nofollow" href="https://spacy.io/" target="_blank">spaCy</a> natural language processing toolkit; and</li>
<li><a rel="nofollow" href="https://github.com/johnmchambers/XRPython" target="_blank">XRPython</a>, John Chamber's interface to Python based on his <a rel="nofollow" href="https://cran.r-project.org/web/packages/XR/index.html" target="_blank">XR package</a> for language extensions to R, which now uses reticulate for its low-level interface to Python.</li>
</ul>
<p>The reticulate package is available now on CRAN. You can find more details in the announcement at the link below.</p>
<p>RStudio blog: <a rel="nofollow" href="https://blog.rstudio.com/2018/03/26/reticulate-r-interface-to-python/" target="_blank">reticulate: R interface to Python</a></p>
<p> </p>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2018/03/reticulate.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/76l-uQEOoiU" height="1"></a></div>