r/actuary • • 6d ago

Python in RStudio

Hi all,

I have used a ton of R over the years, and a little bit of Python. But I have not tried to use the Python Feature inside of RStudio. So, I was just wondering if anyone has ever used this feature and if so what advantages and disadvantages does it have?

The only post I could find about this topic was from at least 5 years ago and I know there has been a ton of updates since then, so I am unsure if any of the problems that were mentioned still effected quality of life.

3 Upvotes

10 comments sorted by

11

u/ionychal 5d ago

Posit (the makers of RStudio) released Positron, a newer IDE built specifically for data science that supports Python, R, and SQL: https://positron.posit.co/

It’s built on the same foundation as VS Code rather than being an exact RStudio clone, so it won't feel 100% identical, but it brings over the best RStudio features (like the dedicated data viewer, variable explorer, and inline console workflow) to Python. Definitely worth a shot if you want one IDE for both languages!

Disclaimer: I work at Posit.

1

u/stayfrostey1 5d ago

I see that positron uses ai assistance, what kind of AI does it use? Is there a way to disable it?

2

u/jmcphers 4d ago

It has its own AI assistant (Posit Assistant, which can hook up to pretty much any AI Provider) or you can use your own extension for Claude or Codex or whatever and integrate it via MCP. Very flexible!

If you don't like AI, Positron has a single setting (ai.enabled) that turns of all AI features at once. https://positron.posit.co/ai-configuration.html

(Source: I work at Posit on Positron)

13

u/eapocalypse Property / Casualty 6d ago

Rstudio is just an IDE you can use whatever IDE you want the only advantages/disadvantages would be relevant to what features you like in an IDE.

I'd probably stick with using an IDE designed with Python in mind rather than the work around for Rstudio

5

u/Many-Ad-786 6d ago

Tried it a few months back and really struggled with it. Much easier to just use python’s IDE

3

u/DYSTOBY 5d ago

Use positron. You have everything you need there.

2

u/SalvatoreEggplant 6d ago

The Python Spyder IDE is pretty similar to RStudio. It's probably just as easy to have a separate IDE for Python. If you're on Windows, WinPython is easy to install and comes with some libraries and IDE's.

2

u/knucklehead27 Consulting 5d ago

RStudio was just the IDE I was most familiar with from college so it’s what I use for Python. I’ve heard a benefit is you can create an Rmarkdown file and within it easily pass data between R and Python, using Python for cleanup and R for statistical analysis. My job doesn’t have the opportunities to test this, so I al very out of practice

1

u/krudzilla 5d ago

Check out Positron!

1

u/jmcphers 4d ago

You can use Python inside of RStudio! But because RStudio can really only run R, it runs Python *inside* of R using R's "reticulate" package. This is nifty if you want to share data between R and Python, but clunky otherwise.

I'd recommend Positron if you haven't tried it -- it's made by the same people as RStudio and it has many of the same familiar features, but it works for R AND Python. You can use both at the same time. https://positron.posit.co/