Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Display 10 bars based on score
- batsman individual_score
- CH Gayle 175
- BB McCullum 158
- AB de Villiers 133
- RR Pant 130
- AB de Villiers 129
- CH Gayle 128
- M Vijay 127
- DA Warner 126
- V Sehwag 122
- SR Watson 121
- i tried reorder for descending order but it does not work.I also tried
- fill = score and batsman to get 10 bar.
- highest_individual_score <- innings%>%
- group_by(match_id,batsman)%>%
- summarize(individual_score = sum(batsman_runs))%>%
- arrange(desc(individual_score))%>%
- ungroup()%>%
- top_n(10, individual_score)%>%
- ggplot(aes(x= batsman, y = individual_score,fill = batsman))+
- geom_bar(stat= "identity", show.legend = FALSE)+
- theme(axis.text.x = element_text(angle = 90))+
- labs(x = "Batsman", y = "Individual Score", title ="Top 10 highest
- individual scorer")
- The above code gives me only 8 bar in alphabetical order. How do i make
- it display 10 bar
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement