Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = data.frame(c("2012","2012","2012","2013"),
- c("AAA","BBB","AAA","AAA"),
- c("X","Not-serviced","X","Y"))
- colnames(df) = c("year","type","service_type")
- year type num_serviced num_notserviced num_total
- 2012 AAA 2 0 2
- ...
- temp = aggregate(df,
- list(type = dat_human_errors$type,
- year = dat_human_errors$year),
- FUN = function(x){NROW(x)})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement