This is an edited version of a previous question.
We are given an mn table of n observations (samples) over m variables (genes, etc.), and we strive to study the behavior of variables between each pair of observations - for example, two observations that have the highest positive or negative correlation. For this, I saw a large diagram in Stadler et.al. Paper of Nature (2011):

Here it can be a sample of the data set to be used.
m <- 1000 samples <- data.frame(unif1 = runif(m), unif2 = runif(m, 1, 2), norm1 = rnorm(m), norm2 = rnorm(m, 1), norm3 = rnorm(m, 0, 5))
I have already tested gpairs(samples) of the gpairs package that produces this one. This is a good start, but it is not possible to set the correlation coefficients in the upper right section, as well as the density graphs in the lower corner:

Then I used ggparis(samples, lower=list(continuous="density")) of the GGally package (Thanks @LucianoSelzer for the comment below). Now we have correlations in the upper corner and densities in the lower corner, but we do not have enough diagonal shading, and the density graphs do not have the form of a heat map.

Any ideas to make it closer to the desired image (first)?
Ali
source share