1. Learn
  2. /
  3. Courses
  4. /
  5. Reshaping Data with tidyr

Connected

Exercise

Counting office occupants

Imagine you're an office facility manager and want to know how many people are present throughout the day. You've installed a sensor at the entrance that counts the number of people entering and leaving the building. The sensor sends an update at the end of every 20 minute time slot if at least one person passed.

To create a dataset ready for visualization, you'll combine the different techniques you've learned so far.

The dplyr and ggplot2 packages have been pre-loaded for you.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Complete the time variable by using the seq() function to create a sequence between the min and max values with an interval of "20 min". Fill NA values of enter and exit with 0L.