I'm trying to create a scatterplotMatrix for my data, then i tried the code taken from https://livebook.manning.com/book/r-in-action/chapter-11/46
scatterplotMatrix(~ mpg disp drat wt | cyl, data=mtcars,
spread=FALSE, diagonal="histogram",
main="Scatter Plot Matrix via car Package")
then i run it
the results are different, and no histogram appears in the plot
and a warning appears
There were 50 or more warnings (use warnings() to see the first 50)
can you tell me where is the problem and how to fix it?
CodePudding user response:
You should mention the method in a list to diagonal
like this:
library(car)
#> Loading required package: carData
scatterplotMatrix(~ mpg disp drat wt | cyl, data=mtcars,
spread=FALSE, diagonal=list(method ="histogram"),
main="Scatter Plot Matrix via car Package")
Created on 2022-10-19 with reprex v2.0.2