I created a ggpairs plot of mtcars database, using variable "vs" as a factor to categorize the plot by color. The legend comes back with the factor() call I'm using, and I want to change the legend title to "Engine Type". ggpairs doesn't seem to like the labs() function. Can anyone assist, please?
suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(GGally)) mtcars %>% ggpairs(., legend = 1, columns = c(1,3,4,6), aes(color = factor(vs, levels = 0:1, labels = c("V-Block", "Straight")))) + theme(legend.position = "bottom") + labs(color = "Engine Type")
Created on 2020-04-06 by the reprex package (v0.3.0)