Created
August 23, 2011 15:13
Variable Interactions
This file contains 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
cor(iris[-5]) | |
pairs(iris[-5], bg=iris$Species, pch=21) |
This file contains 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
cor(iris[-5]) | |
pairs(iris[-5], bg=iris$Species, pch=21) |
This file contains 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
Sepal.Length Sepal.Width Petal.Length Petal.Width | |
Sepal.Length 1.0000000 -0.1175698 0.8717538 0.8179411 | |
Sepal.Width -0.1175698 1.0000000 -0.4284401 -0.3661259 | |
Petal.Length 0.8717538 -0.4284401 1.0000000 0.9628654 | |
Petal.Width 0.8179411 -0.3661259 0.9628654 1.0000000 |
This file contains 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
Sepal.Length Sepal.Width Petal.Length Petal.Width | |
Sepal.Length 1.0000000 -0.1175698 0.8717538 0.8179411 | |
Sepal.Width -0.1175698 1.0000000 -0.4284401 -0.3661259 | |
Petal.Length 0.8717538 -0.4284401 1.0000000 0.9628654 | |
Petal.Width 0.8179411 -0.3661259 0.9628654 1.0000000 |
This file contains 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
library(PerformanceAnalytics) | |
chart.Correlation(iris[-5], bg=iris$Species, pch=21) |
This file contains 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
library(PerformanceAnalytics) | |
chart.Correlation(iris[-5], bg=iris$Species, pch=21) |
This file contains 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
library(quantmod) | |
getSymbols(c('SPY','LQD','GLD')) | |
Data <- cbind(Cl(SPY),Cl(LQD),Cl(GLD)) | |
Year <- as.factor(format(index(Data),'%Y')) | |
chart.Correlation(Data,bg=seq(1:5)[Year],pch=21) | |
par(xpd=TRUE) | |
legend(0, 1, as.vector(unique(Year)), fill=seq(1:5)) |
This file contains 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
library(quantmod) | |
getSymbols(c('SPY','LQD','GLD')) | |
Data <- cbind(Cl(SPY),Cl(LQD),Cl(GLD)) | |
Year <- as.factor(format(index(Data),'%Y')) | |
chart.Correlation(Data,bg=c(1,3,4,5,6)[Year],pch=21) | |
par(xpd=TRUE) | |
legend(0, 1, as.vector(unique(Year)), fill=c(1,3,4,5,6)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment