# NOT RUN {
data(Election2005)
# }
# NOT RUN {
outlm <- outlier1dv(Election2005)
# order data frame based on absolute row and column sums
abssum <- function(x){
x <- abs(x)
return(sum(x))
}
outlm2 <- outlm[order(apply(outlm,1,abssum),decreasing=TRUE),]
# consider only the 50 rows with hightest values
outlm3 <- outlm2[1:50,1:68]
outlm4 <- outlm3[,order(apply(outlm3,2,abssum),decreasing=TRUE)]
# plot in heatmap
library(gplots)
heatmap.2(as.matrix(outlm4), col=colorpanel(20, "red", "white","blue"),
breaks=seq(-1,1,2/20),dendrogram="none",
key=FALSE,trace="none",Rowv=FALSE,Colv=FALSE)
# }
Run the code above in your browser using DataLab