Description Usage Arguments Details Value Author(s) See Also Examples
S3 generic and scaledTrellis method to remove all scaling information from a scaledTrellis
object, returning the prior unscaled trellis object.
1 2 3 |
obj |
An object inheriting from class |
... |
Currently ignored |
Returns the last version of the trellis
object with all addScales
scales and legends removed. Note that this is not the original trellis
object if that was subsequently modified by update
calls. See the examples.
A trellis
object that can be printed/plotted as usual.
Bert Gunter bgunter.4567@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Using simple artificial data
set.seed (2233)
x <- rep(1:10,4)
y <- rnorm(40, mean = rep(seq(10, 25, by = 5), each = 10),
sd = rep(1:4, each = 10))
f <- rep(c("AA","BB","CC","DD"), each = 10)
##
## trellis plot the data with "free" y axis sxaling
orig <- xyplot(y ~ x|f, type = c("l","p"), col.line = "black",
scales = list(alternating =1,
y = list(relation = "free")),
as.table = TRUE,
layout = c(2,2),
main = "revert() Example"
)
## Plot it
orig
## Remove the y axis scales and add horizontal scalelines
orig <- update(orig, scales = list(alternating =1,
y = list(relation = "free", draw = FALSE)))
upd1 <- addScales(orig)
## Plot it
upd1
class(upd1)
## revert
upd2 <- revert(upd1)
## Plot it
upd2
class(upd2)
## clean up
rm(x, y, f, orig, upd1, upd2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.