Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by latent-person

7 hours ago

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

0 comments

latent-person

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities