简体   繁体   中英

Scatter plot matrices with multiple variables in R

我知道pairs(df)是一种很好的散点图绘制方法,可以找到变量中可能存在的相关性,例如最多约10个变量,但是有没有一种方法可以绘制散点图,比如说200个变量?

as @AlexA suggested, one way:

n <- 5
ii <- cumsum(seq.int(ncol(mtcars)) %% n == 0)

pdf('~/desktop/tmp.pdf')
for (i in unique(ii))
  pairs(mtcars[, ii %in% i])
dev.off()

or to get a quick look at them

for (i in unique(ii)) {
  pairs(mtcars[, ii %in% i])
  Sys.sleep(2)
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM