erwann rogard
2008-Nov-01 01:04 UTC
[R] trellis: conditional statements within a panel function
hello,
what i'm trying to achieve is shown in the comment (# ...) below, which is
surely very wrong, but probably intuitively more meaningful that i can
provide in words.
xyplot(y~x2|x1+which,data=make.groups(
"a"=data.a,
"b"=data.b,
"c"=data.c
),
panel=function(...){
panel.abline(a=0,b=0)
panel.points(...)
# if(x1==0 & which=="a") panel.abline(...)
},
layout=c(2,3),
pch=20,
ylim=c(-10,10),
xlab="x2",
cex=0.5
)
thank!
[[alternative HTML version deleted]]
Deepayan Sarkar
2008-Nov-01 02:06 UTC
[R] trellis: conditional statements within a panel function
On 10/31/08, erwann rogard <erwann.rogard at gmail.com> wrote:> hello, > > what i'm trying to achieve is shown in the comment (# ...) below, which is > surely very wrong, but probably intuitively more meaningful that i can > provide in words. > > xyplot(y~x2|x1+which,data=make.groups( > "a"=data.a, > "b"=data.b, > "c"=data.c > ), > panel=function(...){ > panel.abline(a=0,b=0) > panel.points(...) > # if(x1==0 & which=="a") panel.abline(...) > }, > layout=c(2,3), > pch=20, > ylim=c(-10,10), > xlab="x2", > cex=0.5 > )Check ?which.packet. -Deepayan