| t.trellis {HH} | R Documentation |
In S-Plus, change the "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 t.trellis.
## S3 method for class 'trellis': t(x)
x |
any "trellis" object. |
In S-Plus, a warning is generated if the panel component of the
"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.
In S-Plus, a "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.
Richard M. Heiberger <rmh@temple.edu>
Heiberger, Richard~M. and Holland, Burt (2004b). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0-387-40270-5.
In R: t.trellis.
In S-Plus: xyplot.
tmp <- 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))
)