Printing a single row from a ggpairs plot

I wanted to make a ggpairs plot of the mtcars data set, but I only care about the relationship between mpg and all the other variables, not between all of the variables and all of the variables.

I changed some of the 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 the plot

ggpairs(mtcars, colour = "am", columns = c(1,2,8:11))

Is there any way I can show just the first row of the plot?

链接地址: http://www.djcxy.com/p/30862.html

上一篇: ggpairs中的“不正确绘图”标签

下一篇: 从ggpairs图中打印单行