Reordering graphs
The graph you built in the last exercise was readable, but it would be easier to understand it at a glance if it was ordered. Let's use some forcats functions to change the graph so it's ordered in descending order of average usefulness from left to right.
The dataset usefulness_by_platform has been loaded for you.
Cet exercice fait partie du cours
Categorical Data in the Tidyverse
Instructions
- Order
learning_platformin the graph byavg_usefulnessso that, from left to right, it goes from highest usefulness to lowest.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
usefulness_by_platform %>%
# Reorder learning_platform by avg_usefulness
mutate(learning_platform = ___(___, ___)) %>%
# Reverse the order of learning_platform
mutate(learning_platform = ___) %>%
ggplot(aes(x = learning_platform, y = avg_usefulness)) +
geom_point() +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
labs(x = "Learning Platform", y = "Percent finding at least somewhat useful") +
scale_y_continuous(labels = scales::percent_format())