数据量小的时候,一般的散点图矩阵足矣,但是数据量大的时候,很多点重合在一起,效果很差。因此,此时引入颜色来标记散点密度是个不错的想法。效果如下:
[attachment=207]
代码如下:
<br />
library(IDPmisc)<br />
library(SwissAir) # data for the example<br />
<br />
## prepare the data<br />
<br />
Ox <- AirQual[,c("ad.O3","lu.O3","sz.O3")] +<br />
AirQual[,c("ad.NOx","lu.NOx","sz.NOx")] -<br />
AirQual[,c("ad.NO","lu.NO","sz.NO")]<br />
names(Ox) <- c("ad","lu","sz")<br />
<br />
## draw graph<br />
<br />
ipairs(Ox, ztransf = function(x){x[x<1] <- 1; log2(x)})<br />
来自:
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=159