0
회귀선이 포함 된 15 개의 산점도를 플로팅합니다. 그러나 더 나은 시각화를 위해 한 페이지에 표시하고 싶습니다. grid.arrange 함수는 우리의 관심에 따라 여러 개의 그림을 추가하는 데 도움이되지만 항상 오류가 있습니다. 의 GList에서한 페이지에서 여러 개의 플롯 추가 grid.arrange function
오류 (리스트 (wrapvp = 목록 (X = 0.5, y는 0.5 = 폭 = 1, 높이 = 1 : 만
plots <- list()
for (i in 1:(ncol(xx2)-1)) {
cn <- colnames(xx2)
reg<-lm(xx2[,i]~xx2[,16], data=data.frame(xx2))
aa<-summary(reg)
p1<-plot(xx2[,16], xx2[,i], xlab=cn[16], ylab=cn[i],
pch=1, cex.main=1.5, frame.plot=FALSE, col="grey")+ abline(reg, col="blue", lwd=2) + text(max(xx2[,16]/1.3), max(xx2[,i])/2, paste("R-Squared:",round(aa$r.squared,3)),cex = .8)
#plot(density(resid(reg)))
plots[[i]] <- p1
}
grid.arrange(grobs = plots[1:15], ncol=5)
"의 GList"허용 "grobs ' 또는
do.call(grid.arrange, c(plots, ncol=3))
잘못된 태그를 삭제하도록 수정 중입니다. –