Tyu1990 Tyu1990 - 1 year ago 74
R Question

How to create a sum if multiple criteria

I have to create a "sum if" by column with multiple criteria.

I've tried this:

b <- DB.all %>% group_by(Family) %>% summarise(x)

But it doesn't work.

How can I do it?

Answer Source

Try this:

b <- DB.all %>% group_by(Family) %>% summarise(sum(x))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download