4.19 Facetting: Exercise (2)
Load the data:
data <- read_csv("data_twitter_influence.csv")(you can download the data here).
What do you think happens if you try to facet by a continuous variable like
followers_count? What about
party? What’s the key difference?
Take the subset of politicians that have less then 50000 followers (
data %>% filter(followers_count<50000)) and use facetting (
+ facet_grid(var1 ~ var2)) to explore the four-way relationship between
Read the documentation for
?facet_wrap()). What arguments can you use to control how many rows and columns appear in the output?
What does the scales argument in
facetwrap()do? When might you use it?29
Determines whether scales are fixed across all plots or not.↩