← Back to context

Comment by holub008

20 hours ago

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))