[S] passing argument to strip.default()

Jan Schelling (schelling@ivuk.mavt.ethz.ch)
Fri, 06 Mar 1998 15:03:53 +0100

Dear all,
does anybody know how to pass an argument to the strip.default() function
inside a call to a trellis plotting routine?

In detail: I'm trying to customize the text that is printed on the strips
of a multi-panel xy-plot.

My call looks something like this:

plot.test <-
function(data, x, y, z, n, ...) {
z.levels <- rev(sort(unique(data[,z])))
z.factor <- factor(data[,z], levels=z.levels)
strip=function(...) strip.default(..., style=n),

For example, I'd like to pass the parameter n to the style argument of

d <- data.frame(x=rnorm(100), y=rnorm(100), z=rep(1:2,rep(50,2)))
plot.test(data=d, x="x", y="y", z="z", n=5)

I get the following error message:

Error in strip(k, unlist(index[n, ]), gnames, factor = if(v) NULL else
g..: Object "n" not found

If I use
strip=function(...) strip.default(..., style=5),
directly everything is fine.

What am I missing here?



Jan Schelling
Institute of Process Engineering
ETH Zurich, 8092 Switzerland
phone: ++41-1-633 62 63
fax: ++41-1-633 11 19
email: schelling@ivuk.mavt.ethz.ch
internet: http://www.ivuk.ethz.ch
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news