Trying to put error bars on a time series plot using plot.xts
> myTS[1:20]
[,1]
2013-07-01 29
2013-07-03 24
2013-07-03 16
2013-07-03 16
2013-07-03 12
2013-07-03 12
2013-07-03 16
2013-07-03 21
2013-07-03 21
2013-07-03 16
2013-07-05 12
2013-07-05 12
2013-07-05 12
2013-07-05 12
2013-07-08 16
2013-07-08 23
2013-07-08 16
2013-07-08 12
2013-07-09 16
2013-07-09 12
I've aggregated this using myTSquarterly = apply.quarterly(myTS,mean)
> myTSquarterly
[,1]
2013-09-30 24.50829
2013-12-31 23.79624
2014-03-31 24.15170
2014-06-30 24.57641
2014-09-30 23.71467
2014-12-31 22.99500
2015-03-31 24.50423
2015-06-30 25.19950
2015-09-30 24.76330
2015-12-31 24.65810
2016-03-31 25.35616
2016-06-30 22.71066
2016-07-27 20.63636
I can plot easily using plot.xts(myTSquarterly)
:
I can calculate standard deviation easily as well with apply.quarterly(myTS,sd)
I would like to add these standard deviation info as error bars to the plot, but I cannot find a method for this?