(SAMPLE ITERATIVE) Rename and reorder variables
In the previous exercise, you renamed all the variables in ratings
that end with "7day" and kept only a subset of variables. In this exercise, you'll adapt that code to drop some specific columns, while keeping and reordering other columns.
This exercise is part of the course
Curr-Expansion - Introduction to Data Engineering
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Adapt code to drop 28-day columns; keep 7-day in front
viewers_7day <- ratings %>%
___(viewers_7day_ = ends_with("7day"),
___,
___)
# Glimpse
glimpse(viewers_7day)