reticulatepackage makes it easy to use the best of both — together!
More and more I have been working in R and Python and I have come across situations where I’d like to use both together. This can happen for numerous reasons, but the most common one is that you are building something in R, and you need functionality that you or someone else has written previously in Python. Sure, you could rewrite it in R, but that’s not very DRY is it?
reticulate package in R allows you to execute Python code inside an R session. It’s been around for a few years actually, and has been improving more and more, so I wanted to type up a brief tutorial on how it works. It you are an R native, getting
reticulate up and running requires you to understand a little about how Python works — and how it typically does environment management — and so this tutorial may help you get it set up much quicker than if you tried to work it out yourself.
#data #programming #data-science #science #python #why choose between r and python?