1. Learn
  2. /
  3. Courses
  4. /
  5. Manipulating Time Series Data with xts and zoo in R

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.