ggscatmat()
is a faster version of ggpairs()
, but due to some internal trickery, it is a little brittle.
Can you try using ggpairs()
for your plot?
I think your code could be:
library(dplyr)
data %>%
# turn cyl into factor, since it is treated as a factor
mutate(cyl = as.factor(cyl)) %>%
ggpairs(columns = 1:15, mapping = aes(color = cyl))