Comment by rtpg 8 hours ago do you have a snippet of what this looks like in R? 1 comment rtpg Reply 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))
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))
Not OP, but here is an example using tidyverse (I leave the meaning of it to you; should be clear without any R knowledge):