
Last chance! 50% off unlimited learning
Sale ends in
"trellis"
object to effectively, and
after-the-fact convert formulas from (y ~ x | g)
to (x ~
y | g)
. This is needed in S-Plus because most S-Plus trellis
functions do not permit factors on the right-hand side of the formula.
In R lattice functions, factors are permitted on the right-hand side
of the formula. Therefore, to change the x and y axes within each
panel, change the formula from (y ~ x | g)
to (x ~ y |
g)
. The HH t.trellis
function in R calls
lattice::t.trellis
to interchange the conditioning variables
for an R trellis object. See update.trellis
.## S3 method for class 'trellis':
t(x)
"trellis"
object."trellis"
object with all x and y components
interchanged.
In R, the argument "trellis"
object is sent to lattice::t.trellis
to interchange the conditioning variables."trellis"
object is a function. No warning is generated when
the panel component of the "trellis"
object is a character
string naming the function. We interchange the x
and y
values of the c("x", "y", "xlab", "ylab", "xlim", "ylim",
"adj.xlim", "adj.ylim")
components of the "trellis"
object,
and are aware of special features of the panel functions listed in the
S-Plus version of t.trellis
. The transpose will usually work
correctly for other panel functions.update.trellis
#endif
#ifdef S-Plus
xyplot
#endiftmp <- data.frame(y=rnorm(30), x=factor(rep(1:3,10)))
if.R(r=
bwplot(y ~ x, data=tmp)
,s=
t(bwplot(x ~ y, data=tmp))
)
Run the code above in your browser using DataLab