散点图矩阵
问题描述:
这里是我一起工作的脚本:散点图矩阵
data(mtcars, package= "datasets")
diacars <- subset(mtcars,select = c(mpg,disp,hp,drat,wt,qsec))
summary(diacars)
corMat <- cor(diacars, method= "pearson")
round(corMat,2)
car::scatterplotMatrix(~mpg+disp+hp+drat+wt+qsec, data=diacars, diagonal="density",
smoother=gamLine)
corrplot::corrplot(corMat, col=colors, method="ellipse", order="FPC",
diag=FALSE, addCoef.col="green")
是将重点放在这一部分:
car::scatterplotMatrix(~mpg+disp+hp+drat+wt+qsec, data=diacars, diagonal="density",
smoother=gamLine)
散点图矩阵应该是这个样子:
但它没有。
答
你看看gamLine的各种参数smoother.args
。请参阅以下链接https://www.rdocumentation.org/packages/car/versions/2.1-5/topics/ScatterplotSmoothers
,并参与讨论。你应该找到答案,希望。