# NOT RUN {
data(Election2005)
# }
# NOT RUN {
# spline-based measure for all pairs of variables
spl <- splines2d(Election2005)
# order the pairs decreasing
o_spl <- spl[with(spl,order(spl[,1],decreasing=TRUE)),]
# show the 10 pairs with highest values
o_spl[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_spl$nx1[i]))),
with(Election2005,get(as.character(o_spl$nx2[i]))),
xlab=paste(o_spl$nx1[i]),ylab=paste(o_spl$nx2[i]),pch=19)
}
# }
Run the code above in your browser using DataLab