cureopk.blogg.se

Using python in rstudio
Using python in rstudio







using python in rstudio

  • Make edits to my functions, methods, whatever.
  • Load the reticulate package, set conda with use_condaenv() and then repl_python.
  • Open Rstudio project for my python package.
  • The flow below solves the issue above, and represents the process by which I have been editing and seamlessly test my code all without leaving RStudio. You may properly uninstall/install your work locally, even in the conda environment, but you won’t see the changes in Rstudio.

    using python in rstudio

    If I make a change to my package, and need to retest the code locally, things start to get hairy. For my package above, I manage my environment using conda. Reticulate is fantastic and can hook into environments on our machine.

    using python in rstudio

    This is not meant to call out the quirks of developing python packages using RStudio and reticulate, but is a note to my future self as to the tricks necessary to work around some issues that are pretty annoying. With that said, here are a few things that tripped me up along the way. Is it because I am more comfortable with the Rstudio interface? Perhaps, but I really do believe RStudio could be THE data science IDE of the future. If I must say, the experience has been really pleasant, but more importantly, I am writing code at a much faster rate. Last week, I got fed up and came back to RStudio. I mention the tools above because my development has been really slow outside of RStudio. Over the last year, I have been (slowly) working on a python package to help facilitate the collection and analysis of datasets that are openly available within higher education.

    using python in rstudio

    Historically there have been other attempts to bridge the gap, but from a feature and usability perspective, this is by far the most robust offering if you ask me. It is not without it’s quirks, but by and large, the combo work really well, especially for a younger solution. There has been plenty written about reticulate, so I will let you dive into the tutorials and background.









    Using python in rstudio