In the previous chapter, we introduced the core class in R for time series data, the ts object. In this chapter, we will focus on another common data structure for time series data—the zoo class and its extension and the xts class, from the zoo and xts packages respectively. Those two classes are popular in the domain of financial time series analysis (that is, stock prices, indices, and so on), mainly due to their index format, which can store external date and time objects such as the Date, POSIXct/lt, yearmon, and yearqtr classes. Throughout this chapter, we will introduce methods and techniques for creating, manipulating, and visualizing zoo and xts objects.
In this chapter, we will cover the following topics:
- Creating, working with, and manipulating zoo and xts objects
- The attributes of the zoo and xts classes
- The yearmon and yearqtr...