我使用plotmatrix来查找数据帧中的相关性:
# Reduce dataset to 1000 to make things run faster
d <- diamonds[sample(nrow(diamonds), 1000),]
plotmatrix(d[,-c(2:4)]) + geom_smooth(color="steelblue", method="lm")只要不同的列具有相同的比例,就可以很好地工作。如果不是,则具有小比例的列将变得无用。如果运行上面的示例,您可以看到,价格是最大的,因此它会杀死所有其他列。
为了在网格中解决这个问题,我通常会使用以下命令让ggplot独立绘制每个比例:
scales="free_x"但是,我如何将其传递到plotmatrix,或以某种方式使plotmatrix独立缩放?

发布于 2012-10-27 03:55:57
基于上面joran的评论,使用GGally包中的ggpairs:
# Reduce dataset to 1000 to make things run faster
d <- diamonds[sample(nrow(diamonds), 1000),]
ggpairs(d[,-c(2:4)], lower=list(continuous = "smooth"))https://stackoverflow.com/questions/13092823
复制相似问题