问题 I wanted to combine a ggpairs plot with a heatmap and found a wonderful solution: ggpairs plot with heatmap of correlation values #library library(GGally) library(ggplot2) #data sample_df <- data.frame(replicate(7,sample(0:5000,100))) colnames(sample_df) <- c("KUM", "MHP", "WEB", "OSH", "JAC", "WSW", "gaugings") #function for heatmap my_fn <- function(data, mapping, method="p", use="pairwise", ...){ # grab data x <- eval_data_col(data, mapping$x) y <- eval_data_col(data, mapping$y) #