Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. df = data.frame(c("2012","2012","2012","2013"),
  2. c("AAA","BBB","AAA","AAA"),
  3. c("X","Not-serviced","X","Y"))
  4. colnames(df) = c("year","type","service_type")
  5.  
  6. year type num_serviced num_notserviced num_total
  7. 2012 AAA 2 0 2
  8. ...
  9.  
  10. temp = aggregate(df,
  11. list(type = dat_human_errors$type,
  12. year = dat_human_errors$year),
  13. FUN = function(x){NROW(x)})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement