Re: [R] Expressions in lattice conditional variables

2013-03-02 Thread Peter Ehlers
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

Re: [R] Expressions in lattice conditional variables

2013-03-02 Thread Frank Harrell
Whoops - these 2 lines should have been omitted from the program: n <- sprintf('%s (n%s=%g, n%s=%g)', v, nam[1],n[1], nam[2],n[2]) vn[var == v] <- n Frank Harrell wrote > I would like to have a lattice conditioning ( | var ) variable have > expression() as values because I want panel lab

[R] Expressions in lattice conditional variables

2013-03-02 Thread Frank Harrell
I would like to have a lattice conditioning ( | var ) variable have expression() as values because I want panel labels to be able to use plotmath notation for subscripts, etc. lattice barks at this. Does anyone know of a trick workaround? An attempted example program is below. Thanks -Frank r