Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require(latticeExtra)
require(directlabels)
require(reshape2)
require(quantmod)
getSymbols("VUSTX",from="1990-01-01")
getSymbols("VBMFX",from="1990-01-01")
bonds.tr <- merge(ROC(VUSTX[,6],250),ROC(VBMFX[,6],250))
colnames(bonds.tr) <- c("VanguardLongTsy","VanguardTotBnd")
bonds.melt <- melt(as.data.frame(cbind(as.Date(index(bonds.tr)),coredata(bonds.tr))),id.vars=1)
colnames(bonds.melt) <- c("date","fund","totret250")
bonds.melt$date <- as.Date(bonds.melt$date)
asTheEconomist(
horizonplot(totret250~date|fund,origin=0,horizonscale=0.05,
data=bonds.melt,
strip=TRUE,strip.left=FALSE,par.strip.text=list(cex=1.1),
layout=c(1,2),
main="Vanguard Bond Funds 250 Day Total Return"))
direct.label(
xyplot(bonds.tr,screens=1,
ylim=c(-0.35,0.35),scales=list(y=list(rot=0)),
col=theEconomist.theme()$superpose.line$col,
par.settings=theEconomist.theme(box="transparent"),
lattice.options=theEconomist.opts(),
xlab=NULL,
main="Vanguard Bond Funds 250 Day Total Return"),
list("last.points",hjust=1,cex=1.2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.