I am trying to split a time series data of oil prices spanning 35 years at particular year. For example, all data up to 2018 into one series and later data into another. Can I use the split()
function to do the same? More details about the time series below.
> str(myxts)
An ‘xts’ object on 1986-01-15/2020-09-15 containing:
Data: num [1:417, 1] 22.9 15.5 12.6 12.8 15.4 ...
Indexed by objects of class: [Date] TZ: UTC
xts Attributes:
Thanks in advance.