ggobi / ggally

R package that extends ggplot2

Home Page:http://ggobi.github.io/ggally/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ggcorr() suggestion, add option to provide custom labels for the variables

go4ino opened this issue · comments

For the function ggcorr() I think adding an option to change the variable labels with an input field in the function call would be great addition.

I know you can kind of accomplish this by renaming the columns in the original dataframe, but that runs into issues if you'd like more complex names like Mug Moment Aggregate %age, and then you will want to change the column names back for other functions.

For example with the current ggcorr

library(tidyverse)
library(GGally)
data("economics")
ggcorr(economics, label = TRUE)

image

And the new input option could look something along the lines of

library(tidyverse)
library(GGally)
data("economics")

ggcorr(economics, label = TRUE, var_labels = c('pers_consum_expen', 'population', 'ps_rt', 'bigChungus', 'unemployed')  )

image