← Back to context

Comment by wsowens

19 hours ago

Despite writing most of my procedural code in Python, I've always preferred doing my data analysis in R. For all of R's warts, the ergonomics of the dplyr + ggplot + the rest of the tidyverse are very tough to beat. My few attempts to use Pandas and matplotlib/seaborne have always proved frustrating. Based on this cheatsheet though, it seems like Polars addresses some of the friction of Pandas. Looking forward to trying it!

Agreed, as an R and polars user. The fundamental advantage R holds over other languages/libraries is expressions. The ability to reference columns directly AND interoperate with vectorized base ops in R is unfair. Of course, this super power is equally confusing to learners, fraught for production code, etc.

  • do you have a snippet of what this looks like in R?

    • Not OP, but here is an example using tidyverse (I leave the meaning of it to you; should be clear without any R knowledge):

        purchases |>
          group_by(country) |>
          filter(amount <= median(amount) * 10) |>
          summarize(total = sum(amount - discount))

Less friction, considerably faster. I have a statistician friend who's recently made the jump away from R. I think he would agree with you.