Skip to content
Prev 318609 / 398506 Next

Expressions in lattice conditional variables

Frank,

As you probably realize, the problem is not with lattice but with
unique (actually: .Internal(unique, ...)):

   unique(expression('a','b','b'))

generates your error.

Lattice needs a factor variable for the panels, and it tries to
use unique() on your 'vn' to do that.

For example, if you replace '|vn' with '|as.character(vn)', you'll
get the plot, but of course the strip labels are a mess.

I'm not sure that I understand your need correctly, but if it's
a matter of creating the strip labels, then I would explore using
the factor.levels argument to strip.default().

I hope that this isn't totally out to lunch.

Peter Ehlers
On 2013-03-02 09:20, Frank Harrell wrote: