Thank you, this works for my example.
On Sep 22, 2009, at 9:17 PM, Gabor Grothendieck wrote:

>
> f <- function(fo, data, groups) {
> 	g <- do.call("xyplot", list(as.formula(fo), groups = as.name 
> (groups), data))
> 	print(g)
> }

But xyplot allows expressions for the groups parameter also,
and using as.expression instead of as.name in your example does not  
work.
What is happening?

> f <- function(fo, data, groups) {
> 	g <- do.call("xyplot", list(as.formula(fo), groups = as.expression 
> (groups), data))
> 	print(g)
> }

f("yield ~ variety ~ site",barley,"year")

produces a very nicely labeled but empty plot.


	[[alternative HTML version deleted]]


