Skip to content
Prev 333193 / 398506 Next

Merge xts and Return.portfolio

On Fri, Nov 15, 2013 at 6:32 AM, Simone Medori <simone.medori at me.com> wrote:
Yes, this is the reason.  Specifically, the cause is the difference in
timezone between the POSIXct index and the Date index.

For some reason, Return.portfolio returns a xts object with a POSIXct
index.  Convert it to Date and your merge will work.
rp <- Return.portfolio(returns)
index(rp) <- as.Date(index(rp))
merge(returns,rp)
Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com