Re:Big Book of R
by aquafox on Friday April 11, 2025 @01:09AM
(#43650677)
Why not mix R and Python in interactive analysis workflows:
1) Download 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)
4b) Write a few helper functions that pass objects between R and Python by reading/writing a temporary file.
[ Parent
| on HN ]
This 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.
Re:Big Book of R
by goosedragons on Friday April 11, 2025 @01:36PM
(#43656358)
Org mode in Emacs is even better at this IMO. Only downside is that no guarantee other people use Emacs too.
Re:Big Book of R
by b-rodrigues on Friday April 11, 2025 @03:12PM
(#43657369)
I'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
and here's an example pipeline https://github.com/b-rodrigues/rixpress_demos/tree/master/py...
Is 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).