Created
March 3, 2013 17:58
-
-
Save JoesDataDiner/5077286 to your computer and use it in GitHub Desktop.
All That Glitters - Correlation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Extract the correlation of gold to other assets | |
gold_data = rolling.correlmatrix[((rolling.correlmatrix$Var1=="GLD") * (rolling.correlmatrix$Var2 !="GLD")) == 1,] | |
#plot the evolution of the correlation of gold | |
ggplot(gold_data, aes(y = Var2, x = quarter, fill = Correl))+ | |
geom_tile() + | |
scale_fill_gradientn(colours = mycolvec_2 | |
,limits = c(-1,1))+ | |
facet_grid(.~year)+theme_bw() + | |
theme(panel.grid.major.x = element_blank(), | |
panel.grid.major.y = element_blank(), | |
axis.title.x = element_blank(), | |
axis.title.y = element_blank(), | |
axis.text.x=element_text(angle=90)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment