Thanks, all. As I said, just familiarizing myself with the package, and
having a real "facepalm" moment (several, actually) as I realize that I
spent several weeks of spare time building manually as functions what
quantmod does nicely (and much faster) in just one line of code.

But it also solves other puzzles I hadn't gotten to yet, so very pleased to
see it. Sorry for not connecting the dots on "adjusted" returns (despite
having read about that) and the included output-- and thanks for the gentle
coaching.

---------------------------------------
David L. Van Brunt, Ph.D.
mailto:dlvanbrunt@gmail.com


On Sun, Dec 5, 2010 at 3:16 PM, Carlos Ungil <carlos.ungil@gmail.com> wrote:

> Hi Dave,
>
> did you look at the data ?
>
> VTIgoogle=getSymbols("VTI",src="google",auto.assign=FALSE)
> VTIyahoo=getSymbols("VTI",src="yahoo",auto.assign=FALSE)
> par(mfrow=c(3,1))
> plot(VTIgoogle)
> plot(VTIyahoo)
>
> There was a split in 2008, Google prices are adjusted but Yahoo prices
> are not... In fact Yahoo gives also an adjusted series, which makes
> 2008 returns more reasonable, but it's also corrected for dividends
> and the returns will now be slightly larger every year. The most
> recent dividend dates can be clearly identified in this plot (I don't
> know why the series is much more noisy before 2009):
>
> plot(VTIyahoo$VTI.Adjusted-VTIgoogle$VTI.Close)
>
> Cheers,
>
> Carlos
>
> yearlyReturn(VTIgoogle$VTI.Close)
>           yearly.returns
> 2007-12-31     0.03715347
> 2008-12-31    -0.38357674
> 2009-12-31     0.25994636
> 2010-12-03     0.12364733
>
> yearlyReturn(VTIyahoo$VTI.Close)
>           yearly.returns
> 2007-12-31     0.03715613
> 2008-12-31    -0.69176714
> 2009-12-31     0.25994636
> 2010-12-03     0.12364733
>
> yearlyReturn(VTIyahoo$VTI.Adjusted)
>           yearly.returns
> 2007-12-31     0.05571757
> 2008-12-31    -0.36987496
> 2009-12-31     0.28264882
> 2010-12-03     0.13941356
>
>
>
>
>
>
>
>
> On Sun, Dec 5, 2010 at 7:36 PM, David L. Van Brunt, Ph.D.
> <dlvanbrunt@gmail.com> wrote:
> > Hi.. I was just trying to familiarize myself with the quantmod package,
> and
> > I didn't find any explanation for the following after searching:
> >
> >> getSymbols("VTI",src="google")
> > [1] "VTI"
> >> yearlyReturn(VTI)
> >           yearly.returns
> > 2007-12-31     0.02833664
> > 2008-12-31    -0.38357674
> > 2009-12-31     0.25994636
> > 2010-12-03     0.12364733
> >> getSymbols("VTI",src="yahoo")
> > [1] "VTI"
> >> yearlyReturn(VTI)
> >           yearly.returns
> > 2007-12-31     0.02833865
> > 2008-12-31    -0.69176714
> > 2009-12-31     0.25994636
> > 2010-12-03     0.12364733
> >
> >
> > Any idea why 2008 is so different?  I saw in the documentation that there
> > were issues with Google data for 2003-- but I couldn't find a mention of
> an
> > issue with 2008 there or in searches.
> >
> > Also, the Google Finance web page (http://www.google.com/finance?q=vti)
> > shows the 2008 return to be -40.31%.. Closer to the Google data's return,
> to
> > be sure, but still off.
> >
> > Is there something going on there that didn't make the docs (or at least
> my
> > search of them)?
> >
> > many thanks,
> > -Dave
> >
> >        [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-SIG-Finance@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only. If you want to post, subscribe first.
> > -- Also note that this is not the r-help list where general R questions
> should go.
> >
>

	[[alternative HTML version deleted]]

