How to include density coloring in pairwise correlation scatter plot

Viewed 2559

I have the following code:

library(GGally)
library(nycflights13)
library(tidyverse)

dat <- nycflights13::flights %>% 
       select(dep_time, sched_dep_time, dep_delay,  arr_time, sched_arr_time, arr_delay)  %>% 
       sample_frac(0.01)
dat
ggpairs(dat)

It produces this:

enter image description here

How can I add the density coloring so that it looks like this:

enter image description here

1 Answers
Related