Session Ready
Exercise

Recode factor to plot

In the last exercise, you may have used mutate() to find the difference between the number of premiere and finale episode viewers for each series. This variable, which I created and called viewer_growth, is now available in ratings, and feel free to check out it.

Now let's practice using select() to check the result of another mutate with recode_factor().

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3

If you have examined ratings, you might have seen that series have aired on three different channels: "Channel 4", "BBC One", "BBC Two".

  • Create a new factor variable bbc by recoding channel with two levels using recode_factor(): 0 if that series aired on "Channel 4" and 1 if that series aired on any BBC station.