Skip to content
Prev 2678 / 15274 Next

XTS - endpoints omits price changes

An alternate (simpler) approach using 'quantmod':
monthly.returns
Jan 2007     0.019013286
Feb 2007    -0.016934043
Mar 2007     0.004605120
Apr 2007     0.054321097
May 2007     0.031061724
Jun 2007     0.003999584
Jul 2007    -0.001471671
Aug 2007     0.027802621
Sep 2007     0.050668995
Oct 2007     0.068045785
Nov 2007    -0.069992826
Dec 2007    -0.001755584
[1] 0.1693641
yearly.returns
2007-12-31      0.1693641

What is being called by periodReturn internally:
Delt.1.log
Jan 2007           NA
Feb 2007 -0.016934043
Mar 2007  0.004605120
Apr 2007  0.054321097
May 2007  0.031061724
Jun 2007  0.003999584
Jul 2007 -0.001471671
Aug 2007  0.027802621
Sep 2007  0.050668995
Oct 2007  0.068045785
Nov 2007 -0.069992826
Dec 2007 -0.001755584

see ?periodReturn for more info on formats and options.

Jeff
On Wed, Jul 16, 2008 at 4:30 PM, James <j at jtoll.com> wrote: