sum(cases)
Must be na.rm = TRUE inside the sum parenthesis for the below graph to appear otherwise it will just be a blank graph.
By the way thanks so much for these solutions, they are extremely helpful and teach things which are not taught in the book!