I wanted to create a ggpairs graph of the mtcars dataset, but I don't care what the relationship is between mpg and all other variables, and not between all variables and all variables.
I changed some columns to factors
mtcars$cyl = as.factor(mtcars$cyl)
mtcars$vs = as.factor(mtcars$vs)
mtcars$am = as.factor(mtcars$am)
mtcars$gear = as.factor(mtcars$gear)
mtcars$carb = as.factor(mtcars$carb)
and rand graph
ggpairs(mtcars, colour = "am", columns = c(1,2,8:11))
Is there a way to show only the first line of the graph?
source
share