Is this what you had in mind?
Using the iris dataset:
library(ggplot2)
library(data.table)
library(reshape2) # for melt(...)
library(plyr) # for .(...)
xx <- with(iris, data.table(id=1:nrow(iris), group=Species,
Sepal.Length, Sepal.Width,Petal.Length, Petal.Width))
# reshape for facetting with ggplot
yy <- melt(xx,id=1:2, variable.name="H", value.name="xval")
yy <- data.table(yy,key="id,group")
ww <- yy[,list(V=H,yval=xval),key="id,group"]
zz <- yy[ww,allow.cartesian=T]
setkey(zz,H,V,group)
zz <- zz[,list(id, group, xval, yval, min.x=min(xval), min.y=min(yval),
range.x=diff(range(xval)),range.y=diff(range(yval))),by="H,V"]
# points colored by group (=species)
# density plots for each variable by group
d <- zz[H==V, list(x=density(xval)$x,
y=mean(min.y)+mean(range.y)*density(xval)$y/max(density(xval)$y)),
by="H,V,group"]
ggp = ggplot(zz)
ggp = ggp + geom_point(subset =.(H!=V),
aes(x=xval, y=yval, color=factor(group)),
size=3, alpha=0.5)
ggp = ggp + geom_line(subset = .(H==V), data=d, aes(x=x, y=y, color=factor(group)))
ggp = ggp + facet_grid(V~H, scales="free")
ggp = ggp + scale_color_discrete(name="Species")
ggp = ggp + labs(x="", y="")
ggp

I keep hearing that the same thing is possible using ggpairs(...)
in package GGally. I would love to see an actual example of it. The documentation is inscrutable. Also, ggpairs(...)
is extremely slow (in my hands), especially with large datasets.