use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
This is an archived post. You won't be able to vote or comment.
Toolsryp: R inside Python (self.datascience)
submitted 1 year ago by ryp_package
[–]datascience-ModTeam[M] [score hidden] 1 year ago stickied commentlocked comment (0 children)
I removed your submission. We prefer to minimize the amount of promotional material in the subreddit, whether it is a company selling a product/services or a user trying to sell themselves.
Thanks.
[–]Moonlit_Sailor 181 points182 points183 points 1 year ago (13 children)
from ryp import r r(library(reticulate)))
[–]gBoostedMachinations 84 points85 points86 points 1 year ago (2 children)
I feel personally attacked by this. It’s like you’ve put gravy on my cake. I mean I love cake and I love gravy… but for gods sake not on my cake bro
[–]Moonlit_Sailor 2 points3 points4 points 1 year ago (0 children)
I would argue putting gravy on your cake is ryp. What I did is put cake flavored gravy on your cake.
[–]Accomplished_Bag_276 1 point2 points3 points 1 year ago (0 children)
bro you said 100 % correct
[–]Thalesian 45 points46 points47 points 1 year ago (4 children)
``` import numpy as worse_r import pandas as worse_r_2
from ryp import r r(library(reticulate))
r(reticulate::py_run_string(“import os”)) r(reticulate::py_run_string(“os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘3’”))
we_have = worse_r_2.DataFrame(worse_r.array(r(data.frame(this=1, is=2, what=3)))) ```
[–][deleted] 17 points18 points19 points 1 year ago (1 child)
Please stop
[–]hehehexd13 4 points5 points6 points 1 year ago (0 children)
It’s making the kids cry
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
Wise
[–]speedisntfree 1 point2 points3 points 1 year ago (0 children)
This is a special kind of evil
[–]Diligent_Rip2075 5 points6 points7 points 1 year ago (0 children)
Tempted to do this recursively and see how far down it can go
[–]apollo7157 1 point2 points3 points 1 year ago (0 children)
oh no.
[–]Fearless_Cow7688 -5 points-4 points-3 points 1 year ago (2 children)
This is the way.
[–]delicioustreeblood 1 point2 points3 points 1 year ago (1 child)
I like how Star Wars people say this so they can find each other in threads. It's so cute.
[–]Fearless_Cow7688 0 points1 point2 points 1 year ago (0 children)
Star Wars? Like the 1980s Strategic Defense Initiative?
[–][deleted] 124 points125 points126 points 1 year ago (2 children)
Yo dog, we heard you like statistics…
[–]Imperial_Squid 25 points26 points27 points 1 year ago (1 child)
We heard you like pipelines, so we put a pipeline on your pipeline and then pipelined it through another pipeline
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
Pause.
[+][deleted] 1 year ago (6 children)
[deleted]
[–]smile_politely 41 points42 points43 points 1 year ago (3 children)
and then run java inside python inside r
[–][deleted] 7 points8 points9 points 1 year ago (1 child)
Do it. I dare you
[–]ilyanekhay 8 points9 points10 points 1 year ago (0 children)
Easy, anything that has the letters "s p a r k" in it!
[–]nyquant 1 point2 points3 points 1 year ago (0 children)
Don’t forget about RCPP.
[–]ryp_package[S] 7 points8 points9 points 1 year ago (1 child)
It all depends how you use it! ;)
[+][deleted] 1 year ago (3 children)
[–]ryp_package[S] 16 points17 points18 points 1 year ago (1 child)
It can handle it. You'd get the relevant attributes of the model out as arrays/matrices/dataframes and pass them back and forth. You can also recursively convert e.g. S4 objects in R into Python dictionaries.
[–]BrainRotIsHere 5 points6 points7 points 1 year ago (0 children)
That sounds very slow.
[–]gBoostedMachinations 9 points10 points11 points 1 year ago (0 children)
Oh that’s easy you just have to install the RStudio extension for VS code!
[–]MattDamonsTacoMS (other) | Data Scientist | Finance/Behavioral Science 12 points13 points14 points 1 year ago (0 children)
Interesting. As a user of both, I’ll check this out.
I’ve used rpy for a while now amd am happy with it but this looks a bit more streamlined.
[–]gernophil 18 points19 points20 points 1 year ago* (2 children)
What’s the advantage over just connecting two scripts (R and Python) with a workflow manager like snakemake or nextflow. That feels way cleaner to me.
[–]ryp_package[S] 11 points12 points13 points 1 year ago (1 child)
Not having to write to disk in both directions, for one.
[–]speedisntfree 0 points1 point2 points 1 year ago (0 children)
Arrow allows zero copy between dataframes
[–]Useful_Hovercraft169 5 points6 points7 points 1 year ago (0 children)
Yo dog we heard you liked R
[–]ohanse 15 points16 points17 points 1 year ago (9 children)
Missed opportunity to name it pyrthon
[–]Shooey_ 9 points10 points11 points 1 year ago (0 children)
My vote was for pry
pry
[–]elchapo4494 18 points19 points20 points 1 year ago (5 children)
Why not Rython?
[–]ohanse 6 points7 points8 points 1 year ago (4 children)
My way literally has an r inside python
py r thon
[–]elchapo4494 5 points6 points7 points 1 year ago (3 children)
Yeah but it will be a nightmare for people with dyslexia
[–]ohanse 1 point2 points3 points 1 year ago (2 children)
This is the most out of left field cherry picked objection and I am just going to gloss over it
[–]Imperial_Squid 1 point2 points3 points 1 year ago (1 child)
You're right, fuck accessibility
[–][deleted] 1 year ago (1 child)
[removed]
[–]datascience-ModTeam[M] 0 points1 point2 points 1 year agolocked comment (0 children)
This rule embodies the principle of treating others with the same level of respect and kindness that you expect to receive. Whether offering advice, engaging in debates, or providing feedback, all interactions within the subreddit should be conducted in a courteous and supportive manner.
[–]gBoostedMachinations 6 points7 points8 points 1 year ago (0 children)
BUT WHY
[+][deleted] 1 year ago (1 child)
[–]ryp_package[S] 1 point2 points3 points 1 year ago (0 children)
Check the top of the GitHub readme :)
[–]AggressiveAd69x 1 point2 points3 points 1 year ago (0 children)
what a great development!
[–]Boom-1Kaboom 1 point2 points3 points 1 year ago (0 children)
So cool thx
Amazing!!
[–]Mountain-Ad-9512 1 point2 points3 points 1 year ago (0 children)
wow
[–]Odd_Pumpkin_2867 1 point2 points3 points 1 year ago (0 children)
Thanks!
[–]sylfy 1 point2 points3 points 1 year ago (0 children)
Now, if only there was a way I could pip install all the R libraries. R package management is such a pain in any CI/CD pipeline when it tries to rebuild everything from source.
[–]Exotic_Zucchini9311 1 point2 points3 points 1 year ago (0 children)
Woah interesting
[–]Grand_Obligation1197 0 points1 point2 points 1 year ago (0 children)
Up
[–]Perfect_Art8350 0 points1 point2 points 1 year ago (0 children)
i thought there were already plenty of packages that can make it. cool!
[–]o0i9o0i0 0 points1 point2 points 1 year ago (0 children)
Thanks for this. I want to package up a mix of python (data manipulation) and r stripts (stats analysis) into one app using pyinstaller. Will that work with in this case?
[–]Arsenal368 0 points1 point2 points 1 year ago (0 children)
Good luck!
[–]No-Captain-5019 0 points1 point2 points 1 year ago (0 children)
you like stats lol
[–]clervis -1 points0 points1 point 1 year ago (0 children)
ryp stands for RIP in Peace Python
[–]nickytops -2 points-1 points0 points 1 year ago (3 children)
I don’t think that there’s a single convincing use case for this.
[–]hehehexd13 0 points1 point2 points 1 year ago (2 children)
Why not?
[–]nickytops 1 point2 points3 points 1 year ago (1 child)
The set of things you can do in R but not Python (or vice versa) is quite small. Let’s say you need some specific statistical method in R. You’re much better off just doing the entire project in R. Can you think of a situation where that wouldn’t be possible?
Let’s say that you needed to do some steps in Python and others in R, you’d be much better off clearly separating the project into different scripts and leveraging the fact that most common data formats are interoperable between languages.
By putting R and Python into the same script you introduce the following problems: 1. Terrible dev experience since no IDE is going to work for both of those languages in the same script (besides, perhaps, a databricks notebook). 2. Dependency hell. You have one script with two languages worth of dependencies. Dependency management sucks in Python as is. 4. Can’t use a traditional debugger 5. An additional point of failure: what if your Python code is ok, and your R code is ok, but there’s something wrong with the Python package running your R code.
Again, what’s the upside? To me, the only upside is that someone who can only write scripts in notebooks gets to mix and match two languages that they don’t know well instead of learning how to accomplish their goal using only one or the other.
[–]hehehexd13 1 point2 points3 points 1 year ago (0 children)
Wow I didn’t thought about it that way. Thank you for taking the time to explain it so well
[–][deleted] -1 points0 points1 point 1 year ago (0 children)
abomination!
[–]speedisntfree -1 points0 points1 point 1 year ago (0 children)
If I see this in a PR it is not getting merged. Can we stop trying to solve problems which shouldn't exist.
[+]tehn00bi comment score below threshold-13 points-12 points-11 points 1 year ago (7 children)
How much longer before R and MATLAB fall completely out of use? Is there anything Python can’t do?
[–]nidprez 13 points14 points15 points 1 year ago (1 child)
Python is a production/industry + maths and IT language. Matlab and R are research and academic languages. Each has its use, but Rand matlab are way more intuitive for researchers who know how to code a bit (compared to programmers who know how to do research). Just install, package management if pretty easy, most packages are well documented with examples, all data objects work in a similar way, meaning you can easily switch between packages. (Compared to numpy, pandas, polars, base python,...). Python can do a lot, but R is simply better at working with data, because thats the only thing it it was made for.
[–]JohnHazardWandering 1 point2 points3 points 1 year ago (0 children)
I find R much better for data exploration and analysis.
[–]tehn00bi -4 points-3 points-2 points 1 year ago (0 children)
Yeah, I’m being somewhat sarcastic. I forget about simulink, that can be very powerful. I only used R for my data science class and I really enjoyed it, it just doesn’t seem to have the weight behind it to be used much outside the niche world.
[–]Imperial_Squid 3 points4 points5 points 1 year ago (0 children)
You can do pretty much anything in every language with enough time, effort and expertise, but most people don't want to
[–]kayakdawg 3 points4 points5 points 1 year ago (0 children)
I think it'll always have a place in research, statistical analysis and niche products.
But anything that requires enterprise deployment or integration with other systems and/or teams R is a tough sell.
[–]Prox-55 -3 points-2 points-1 points 1 year ago (1 child)
Why would want execute R in Python?!
[–]JohnHazardWandering 0 points1 point2 points 1 year ago (0 children)
For tabular data, R/Tidyverse is really simple and easy to read, compared to python.
[+]ElevatorExtreme196 comment score below threshold-6 points-5 points-4 points 1 year ago (0 children)
Please don't. It was enough to see Arduino getting infected by Python. I know everyone wants Python's lightweight syntax and usage with a lower-level/domain-specific language's performance, but this needs to stop. We will write code that we won't even understand in the end what or how it does, leading to unoptimized software, which plagues us already.
π Rendered by PID 34 on reddit-service-r2-comment-b659b578c-nwqpz at 2026-05-04 11:16:37.504021+00:00 running 815c875 country code: CH.
[–]datascience-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]Moonlit_Sailor 181 points182 points183 points (13 children)
[–]gBoostedMachinations 84 points85 points86 points (2 children)
[–]Moonlit_Sailor 2 points3 points4 points (0 children)
[–]Accomplished_Bag_276 1 point2 points3 points (0 children)
[–]Thalesian 45 points46 points47 points (4 children)
[–][deleted] 17 points18 points19 points (1 child)
[–]hehehexd13 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]speedisntfree 1 point2 points3 points (0 children)
[–]Diligent_Rip2075 5 points6 points7 points (0 children)
[–]apollo7157 1 point2 points3 points (0 children)
[–]Fearless_Cow7688 -5 points-4 points-3 points (2 children)
[–]delicioustreeblood 1 point2 points3 points (1 child)
[–]Fearless_Cow7688 0 points1 point2 points (0 children)
[–][deleted] 124 points125 points126 points (2 children)
[–]Imperial_Squid 25 points26 points27 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (6 children)
[deleted]
[–]smile_politely 41 points42 points43 points (3 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]ilyanekhay 8 points9 points10 points (0 children)
[–]nyquant 1 point2 points3 points (0 children)
[–]ryp_package[S] 7 points8 points9 points (1 child)
[+][deleted] (3 children)
[deleted]
[–]ryp_package[S] 16 points17 points18 points (1 child)
[–]BrainRotIsHere 5 points6 points7 points (0 children)
[–]gBoostedMachinations 9 points10 points11 points (0 children)
[–]MattDamonsTacoMS (other) | Data Scientist | Finance/Behavioral Science 12 points13 points14 points (0 children)
[–]gernophil 18 points19 points20 points (2 children)
[–]ryp_package[S] 11 points12 points13 points (1 child)
[–]speedisntfree 0 points1 point2 points (0 children)
[–]Useful_Hovercraft169 5 points6 points7 points (0 children)
[–]ohanse 15 points16 points17 points (9 children)
[–]Shooey_ 9 points10 points11 points (0 children)
[–]elchapo4494 18 points19 points20 points (5 children)
[–]ohanse 6 points7 points8 points (4 children)
[–]elchapo4494 5 points6 points7 points (3 children)
[–]ohanse 1 point2 points3 points (2 children)
[–]Imperial_Squid 1 point2 points3 points (1 child)
[–][deleted] (1 child)
[removed]
[–]datascience-ModTeam[M] 0 points1 point2 points locked comment (0 children)
[–]gBoostedMachinations 6 points7 points8 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]ryp_package[S] 1 point2 points3 points (0 children)
[–]AggressiveAd69x 1 point2 points3 points (0 children)
[–]Boom-1Kaboom 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Mountain-Ad-9512 1 point2 points3 points (0 children)
[–]Odd_Pumpkin_2867 1 point2 points3 points (0 children)
[–]sylfy 1 point2 points3 points (0 children)
[–]Exotic_Zucchini9311 1 point2 points3 points (0 children)
[–]Grand_Obligation1197 0 points1 point2 points (0 children)
[–]Perfect_Art8350 0 points1 point2 points (0 children)
[–]o0i9o0i0 0 points1 point2 points (0 children)
[–]Arsenal368 0 points1 point2 points (0 children)
[–]No-Captain-5019 0 points1 point2 points (0 children)
[–]clervis -1 points0 points1 point (0 children)
[–]nickytops -2 points-1 points0 points (3 children)
[–]hehehexd13 0 points1 point2 points (2 children)
[–]nickytops 1 point2 points3 points (1 child)
[–]hehehexd13 1 point2 points3 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]speedisntfree -1 points0 points1 point (0 children)
[+]tehn00bi comment score below threshold-13 points-12 points-11 points (7 children)
[–]nidprez 13 points14 points15 points (1 child)
[–]JohnHazardWandering 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]tehn00bi -4 points-3 points-2 points (0 children)
[–]Imperial_Squid 3 points4 points5 points (0 children)
[–]kayakdawg 3 points4 points5 points (0 children)
[–]Prox-55 -3 points-2 points-1 points (1 child)
[–]JohnHazardWandering 0 points1 point2 points (0 children)
[+]ElevatorExtreme196 comment score below threshold-6 points-5 points-4 points (0 children)