Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Display 10 bars based on score
  2.  
  3. batsman individual_score
  4. CH Gayle 175
  5. BB McCullum 158
  6. AB de Villiers 133
  7. RR Pant 130
  8. AB de Villiers 129
  9. CH Gayle 128
  10. M Vijay 127
  11. DA Warner 126
  12. V Sehwag 122
  13. SR Watson 121
  14.  
  15.  
  16. i tried reorder for descending order but it does not work.I also tried
  17. fill = score and batsman to get 10 bar.
  18.  
  19. highest_individual_score <- innings%>%
  20. group_by(match_id,batsman)%>%
  21. summarize(individual_score = sum(batsman_runs))%>%
  22. arrange(desc(individual_score))%>%
  23. ungroup()%>%
  24. top_n(10, individual_score)%>%
  25. ggplot(aes(x= batsman, y = individual_score,fill = batsman))+
  26. geom_bar(stat= "identity", show.legend = FALSE)+
  27. theme(axis.text.x = element_text(angle = 90))+
  28. labs(x = "Batsman", y = "Individual Score", title ="Top 10 highest
  29. individual scorer")
  30.  
  31. The above code gives me only 8 bar in alphabetical order. How do i make
  32. it display 10 bar
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement