散点图矩阵

时间:2017-10-11 01:24:26

标签: r matrix

以下是我正在使用的脚本:

WITH Inserted (a) AS (
  INSERT INTO A (data)
  VALUES ('data')
  RETURNING A.a
),
BValues (data) AS (
  VALUES
    ('data1'),
    ('data2'),
    ('data3')
)
INSERT INTO B (a, data)
SELECT Inserted.a, BValues.data
FROM Inserted CROSS JOIN BValues;

重点是这一部分:

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")

散点图矩阵应该如下所示:

Correct Scatterplot Matrix

但它没有。

1 个答案:

答案 0 :(得分:0)

您是否考虑过改变gamLine的smoother.args参数。请参阅以下链接https://www.rdocumentation.org/packages/car/versions/2.1-5/topics/ScatterplotSmoothers,并使用参数。你应该找到答案。