4 ms·
Why not mix R and Python in interactive analysis workflows: 1) Download positron: https://github.com/posit-dev/positron https://github.com/posit-dev/positron 2)
by aquafox 2y ago
Why not mix R and Python in interactive analysis workflows:
1) Download positron: https://github.com/posit-dev/positron https://github.com/posit-dev/positron
2) Set up a quarto (.qmd) notebook
3) Set up R and Python code chunks in tour quarto document
4a) Use reticulate to spawn a Python session inside R and exchange objects beween both languages (https://github.com/posit-dev/positron/pull/4603 https://github.com/posit-dev/positron/pull/4603)
4b) Write a few helper functions that pass objects between R and Python by reading/writing a temporary file.
- dkga 2y agoThis is exactly what I do for the vast majority of my academic papers. It combines the power and flexibility of R for statistics, which I agree with the upstream poster is incredibly underrated (especially with tidyverse) with python.
- Annatar 2y ago[dead]
- goosedragons 2y agoOrg mode in Emacs is even better at this IMO. Only downside is that no guarantee other people use Emacs too.
- b-rodrigues 2y agoI'm writing a package called rixpress that leverages Nix to build reproducible pipelines with targets in either R or Python Here's the github to the package https://github.com/b-rodrigues/rixpress/tree/master https://github.com/b-rodrigues/rixpress/tree/master and here's an example pipeline https://github.com/b-rodrigues/rixpress_demos/tree/master/python_r https://github.com/b-rodrigues/rixpress_demos/tree/master/py...
- p00dles 1y agoIs this what tools like Nextflow or Snakemake aim to do? I don't know, and I'm genuinely curious, because I'm starting to work in bioinformatics and doing different parts of an analysis pipeline in R and Python seems common, and, necessary really if you want to use certain packages. I'm wondering if I should devote time to learning Nextflow/Snakemake, or whether the solution that you outlined is "sufficient" (I say "sufficient" in quotes because of course, depends on the use case).