Counting Part 2

While the group_by() and summarize() functions are great for summarizing this information, a Padawan youngling has pointed out that the information is not ordered.

🙄 Rolling your eyes, you tell them that you know this! We just need to use another function in order to arrange this data. It’s time for you to demostrate this. J-327D notes that journalists are typically interested in the most of something, so to make sure to sort in descending order.

Sorting a dataframe

Change the counted list to show the species with the most characters are the top

Solution
starwars |> group_by(species) |> summarize(characters = n()) |> arrange(desc(characters))
starwars |>
  group_by(species) |>
  summarize(characters = n()) |>
  arrange(desc(characters))
Hint

J-327D wonders just how many hints you need, but suggests you check out arrange().

JedR challenge

Your driod editor J-327D has traversed the galaxy but still wonders …

Which species dominates the galaxy?

There are 35 Human characters in the starwars data, the most of all species.

You’re done with this Trial

Great job you have done! Please inform your JedR Master that you have completed this trial. You are free to attempt the next JedR Trial or continue with JedR Training.