Session Ready
Exercise

Row selection with time objects

Often you may need to subset an existing time series with a set of Dates, or time-based objects. These might be from as.Date(), as.POSIXct(), or a variety of other classes. In this exercise you'll explore how, given an xts object x, it is possible to extract relevant observations using a vector of dates in brackets.

The objects x and dates have been pre-loaded in your workspace.

Instructions
100 XP
  • Use the vector dates to subset the object x.
  • Subset x using dates that are first converted to POSIXct.