Skip to content
Prev 2314 / 15274 Next

Monthly returns from Daily prices

Hi Ravi,

I can't really reproduce your data, but once you get the date
converted the following should work.  I've used Starbucks daily data
as an example (and because I need more coffee...)

library(quantmod)
getSymbols("SBUX", src='yahoo')

Delt(Cl(to.monthly(SBUX)),type='arithmetic')
Delt(Cl(to.monthly(SBUX)),type='log')

# this will compute the discrete (arithmetic) return as well (though
it is slower):

monthlyReturn(Cl(SBUX))

Jeff
On Mon, Mar 24, 2008 at 6:26 AM, Ravi S. Shankar <ravis at ambaresearch.com> wrote: