# NOT RUN {
data(Election2005)
# }
# NOT RUN {
# distance correlation for all pairs of variables
dcor <- dcor2d(Election2005)
# put the pairs in decreasing order
o_dcor <- dcor[order(dcor$dcor2d,decreasing=TRUE),]
# Show the 10 pairs with highest values
o_dcor[1:10,]
# Show the 4 scatterplots with highest values
par(mfrow=c(2,2))
for(i in 1:4){
plot(with(Election2005,get(as.character(o_dcor$nx1[i]))),
with(Election2005,get(as.character(o_dcor$nx2[i]))),
xlab=paste(o_dcor$nx1[i]),ylab=paste(o_dcor$nx2[i]),pch=19)
}
# }
Run the code above in your browser using DataLab