# \donttest{
# deformations
data(solar)
m0 <- deform(solar$x, solar$z, solar$n)
# plot representation of deformation
plot(m0)
# as above with specified x and y grid
xvals <- seq(-123.3, -122.25, by = .05)
yvals <- seq(49, 49.4, by = .05)
plot(m0, xp = xvals, yp = yvals)
# }
# one-dimensional expansion
data(solar)
m1 <- expand(solar$x, solar$z, solar$n)
# plot its three dimensions
op <- par(mfrow = c(1, 3))
plot(m1)
par(op)
# or plot using lattice::levelplot
plot(m1, graphics = 'lattice')
# or as above, but on one page
plot(m1, graphics = 'lattice', onepage = TRUE)
# \donttest{
# two-dimensional expansion
m2 <- expand(solar$x, solar$z, solar$n, c(8, 5))
# plot of its third and fourth dimensions for given x and y values
op <- par(mfrow = c(1, 2))
plot(m2, start = 3, xp = xvals, yp = yvals)
par(op)
# using lattice::levelplot with common breaks across dimensions with
# a palette that gives latent dimensions in white where near zero
plot(m2, onepage = TRUE, graphics = 'lattice', breaks = seq(-0.35, 0.35, by = 0.1),
pal = function(n) hcl.colors(n, 'Blue-Red 3'))
# }
Run the code above in your browser using DataLab