Controlling placement of empty lattice panels

lattice, r

Solution

The `as.table=TRUE` option should do this for most lattice plots by filling in the top row first instead of the bottom row.

Problem

When plotting fewer panels than the full grid you get a gap without a panel. Most lattice functions puts the gap in the top right, but I would like to have it in the lower right, as `marginal.plot` does (see the picture). Is there a way to make other lattice functions do the same? I know the panel order is decided by the order of the factor levels of the conditioning variable, or by using the `index.cond` argument, but that does not help me here. I have tried to decipher the code of `marginal.plot`, but haven't been able to figure it out, so any help is appreciated!

Original source