Session Ready
Exercise

Converting xts objects to data.tables

Converting to a data.table is easy with the built-in as.data.table() function. Note that this function has an xts-specific method! You'll need to do a little manipulation of names, but otherwise the conversion is straightforward.

A sample xts object called nickelXTS has been loaded into the session for you.

Instructions
100 XP
  • convert nickelXTS to a data.table called nickelDT.
  • Change nickelDT's column names. Specifically, the primary time column should be changed to "spot_price_timestamp".