r/rstats • u/starcash728 • Oct 12 '24
r/rstats • u/mantisalt • May 04 '26
R on a Flip Phone
Solving the classic issue of needing powerful machine learning on the go... hmm...
Writeup. I also managed to knit an Rmd page and push a git commit :0
r/rstats
•
u/laplasi
•
Sep 18 '24
Why I'm still betting on R
(Disclaimer: This is a bit of a rant because I feel the R community has been short-changed in the discussion about which tool is the 'best for the job'. People are often too nice and end up committing what I think is a balance fallacy - they fail to point out serious arguments against Python/in favour of R simply because they are conflict averse and believe that the answer is always "both". The goal of this article is to make a slightly stronger/meaner argument than you will usually hear in favour of R because people deserve to hear it and then update their beliefs accordingly.)
One of my favourite articles in programming is Li Haoyi's From First Principles - Why Scala. In it, the author describes the way in which many programming languages (old and new) are evolving to become more like Scala. In biology, this is called convergent evolution. Animals from different branches of the tree of life end up adopting similar forms because they work. Aquatic mammals look like fish, bats look like birds and Nature is always trying to make a crab.
Right now, I've noticed these are some of the biggest trends in the data science community:
Piping - see PRQL and GoogleSQL
Dataframe libraries with exchangeable backends - see Ibis
Lazy evaluation and functional programming - Polars
Programmable (i.e. easy to iterate and branch), SQL-like modular ETL workflows - dbt
If you are familiar with R and the Tidyverse ecosystem, you'll realize that if you were to add all these four trends together you would get the dplyr/dbplyr library. What people are doing now with these tools is nothing that could not have been done 3 or 4 years ago with R.
When I first started programming with R, I was told that it was slower than Python and that whatever benefits R had were already ported over to Python so there was no point in continuing with R. This was in 2019. And yet, even in 2021 R's data.table package was still the top dog in terms of benchmarks for in-memory processing. One major HackerNews post announcing Polars as one of the fastest dataframe libraries has as its top comment someone rightly pointing out that data.table still beats it.
I feel like this has become a recurring theme in my career. Every year people tell me that Python has officially caught up and that R is not needed anymore.
Another really great example of where we were erroneously that R was a 'kiddy' language and Python was for serious people was with Jupyter notebooks. When I first started using Jupyter notebooks, I was shocked to realize that people were coding inside what is effectively an app. You would have thought that the "real programmers" would be using the tool that encourages version control and reproducibility through compiling a plain text markdown document in a fresh environment. But it was the other way around. The people obsessed with putting things in production reliably standardized around the use of an app to write non-reproducible code while the apparently less 'production ready' academics using R were doing things according to best practise.
Of course, RMarkdown, dplyr and data.table are just ease of life improvements on ideas that are much older in R itself. The more I've learned about it, the more I've realized that even as a programming language R is deeply fascinating and is no less serious than Python. It just has a different, less mainstream heritage (LISP and functional programming). But again, many of the exciting new languages today like Rust and Kotlin are emphasizing some of the lighter ideas from functional programming for day to day use.
Whether it was about Pandas or Jupyter or functional programming, I have to admit I have a chip on my shoulder about being repeatedly told that the industry had standardized on whatever was in vogue out of the Python community at the time and that that stuff was the better tooling as a result. They were all wrong. The 'debate' between tidyverse and data.table optimizations is so tiny compared to how off the mark the mainstream industry got things. They violated their own goals: Pandas was never pythonic, Jupyter was never going to be a production grade tool and even now, frameworks like Streamlit have serious deficiencies that everyone is ignoring.
I know that most jobs want Python and that's fine. But I can say for sure that even if I use Python exclusively at work, I will always continue to look to the R community to understand what is actually best practise and where everyone else will eventually end up. Also, I'll need the enormous repository of statistics libraries that still haven't been ported over really helps.
r/rstats • u/mantisalt • May 26 '26
Live Videoconference in the R Console
Back again with another evil project (writeup). Managed to get the delay under a second, and the rendering framerate is passable (10fps). This project is particularly silly because it uses an (unnecessarily) awful streaming strategy...
I haven't gotten to test outside of localhost because eduroam blocks port forwarding (lol), but it should work between two computers. Would love to see if anyone gets this running.
r/rstats • u/Puzzleheaded-Lead895 • Sep 30 '24
A package to help you choose the right picture size for a ggplot
r/rstats • u/arthurwelle • Jun 04 '21
I just created my first package {codehover}. In a Rmd template that allows you to create a hover effect to show intermediary steps of the code. https://arthurwelle.github.io/codehover/articles/codehover_intro.html
r/rstats • u/dudeski_robinson • Sep 04 '26
marginaleffects 1.0.0
Hi everyone,
Big news: marginaleffects 1.0.0 is out on CRAN.
For those who don't know, marginaleffects is a package that facilitates the _post-estimation_ workflow: using a fitted model to produce meaningful numbers that are easy to interpret substantively.
It supports ~100 different kinds of models and gives you a common workflow to produce a bunch of the usual quantities of interest: average predictions (aka marginal means), comparisons (aka contrasts), and slopes (aka marginal effects). It is crazy flexible, and allows you to conduct arbitrary hypothesis tests on any of these quantities. So you can easily answer questions like: What is the average treatment effect of X, and does it vary across strata Z? Or what is the average expected level of my outcome variable in the K subgroup?
Version 1.0.0 a big number and it feels like a big step.
I wrote a blog on the challenges of interpreting statistical models, SPEED, cool new features, the future, and a 5 year package development and writing odyssey.
https://arelbundock.com/posts/marginaleffects100
And check out the main website. It hosts an entire (free) book, with about 40 different chapters of tutorials and case studies.
r/rstats • u/aredoubles • Feb 04 '26
dplyr 1.2.0 released - adds filter_out, recode_values, replace_values, replace_when, etc.
r/rstats • u/Unicorn_Colombo • Apr 14 '26
R core developer Tomáš Kalibera passed away on 1th April
stat.ethz.chr/rstats • u/landschaften • Dec 03 '25
Wanted to share some art I made with R!
So while I didn't compile the poster in R, the raw graphics were generated in R. I wanted to make an ecological calendar, with data for eclipses, day length, precipitation, vegetation amount, and bird diversity plotted over the course of a year. And with the code I wrote in R, I am able to generate a graphic like this for anywhere in the contiguous US! Both the inner rings and the outer eclipse bands were made using the help of the circlize package, which does some really cool circular plotting. If anyone wants to see what it looks like for other locations, check out my Etsy.
r/rstats • u/malditobarbudo • Jan 18 '20
My mother liked my laptop stickers and did this "tidy" phone/hdd patchwork bag 😍
r/rstats • u/Johnsenfr • Apr 24 '26
R 4.6.0 released
The newest version of **R** was released today!
See the NEWS here.
And yes: %notin% is finally in base R :-D
r/rstats • u/davisvaughan • Feb 10 '26
`dplyr::if_else()` and `dplyr::case_when()` are up to 30x faster
Last week we released dplyr 1.2.0, but we left off something VERY important 🙂
dplyr::if_else() and dplyr::case_when() are now up to 30x faster and use 10x less memory!
We dive into how we achieved these numbers in this new post!
And for package developers, an extra special gift! The low dependency vctrs package now has:
vec_if_else()vec_case_when()vec_replace_when()vec_recode_values()vec_replace_values()
Use these in your packages when you want the consistency of the tidyverse with minimal dependencies!
r/rstats • u/jcasman • Dec 11 '25
Major new investment in the future of the R language announced! Over USD $650,000 to support R community contributors
R Consortium applauds the R Foundation and R Core on a major new investment in the future of the R language.
Over USD $650,000 to support R community contributors.
The Software Sustainability Institute’s Research Software Maintenance Fund has awarded £499,981.21 over 24 months for the project “Enabling the Next Generation of Contributors to R.” This work will:
Mentor a new cohort of expert contributors to R
Modernize core development infrastructure and governance
Implement a project-wide code of conduct
Strengthen communication and outreach across the global R community
Led by Aad van Moorsel (University of Birmingham) with co-leads Adrian Garcia, Heather Turner, Ella Kaye, international co-leads including Gabriel Becker, Kylie Bemis, Mikael Jagan, Jeroen Ooms, Peter Dalgaard, Simon Urbanek, and in collaboration with the R Core Team, this project directly addresses continuity, diversity, and long-term sustainability for a language that underpins research worldwide.
R Consortium is honored to participate as a partner alongside the R Foundation, Posit, Google, A2-Ai, and others in strengthening the foundations of R for the next generation of contributors and users.
Learn more about the Research Software Maintenance Fund and Round 1 projects: