Session Ready
Exercise

Combining first and last

Now that you have seen how to extract the first or last chunk of a time series using natural looking language, it is only a matter of time before you need to get a bit more complex.

In this exercise, you'll extract a very specific subset of observations by linking together multiple calls to first() and last().

# Last 3 days of first week
last(first(Temps, '1 week'), '3 days') 

You will reconfigure the example above using the temps data from the previous exercise. The trick to using such a complex command is to work from the inside function, out.

Instructions
100 XP
  • Find the first three days of the second week of the temps data set. Use combinations of first() and last() to do this.