rp.surface | R Documentation |
This function plots a surface and uses interactive interrogation by the mouse, or a sequence of animations, to indicate the uncertainty in the surface as an estimate of the true surface.
rp.surface(surface, covariance, x1grid, x2grid, x, y, Display = "persp", hscale = 1, vscale = hscale, panel = TRUE, Speed = 5, ntime = 10, ninterp = 50, zlim = NULL, col.palette = topo.colors(100), coords = rep(NA, 2))
surface |
a matrix of estimated surface values over a regular grid. |
covariance |
the covariance matrix for the estimates in |
x1grid, x2grid |
vectors defining the regular grids over each margin of |
x |
an optional two-column matrix of observed covariate values. |
y |
an optional vector of response values. |
Display |
a character value which determines the initial type of surface plot. Options are "image" (the default) and "persp". |
hscale, vscale |
scaling parameters for the size of the plot. |
panel |
a logical variable which determines whether a panel is created to allow interactive control. |
Speed |
this determines the initial value of the speed of animations by setting the value of the sleep time (in hundredths of a second, with an offset of 2) between displayed surfaces. |
ntime |
the number of interpolated surfaces displayed between successive simulated surfaces, to control the smoothness of the animation. |
ninterp |
the number of grid values in each dimension when constructing a surface for the "image" display option. This is used because the input grid of |
zlim |
a vector of length two which defines the range of plotting on the surface scale. By default, |
col.palette |
the colour palette used to paint the surface. The colours are determined simply by the height of the surface. |
coords |
a vector of length two which defines the location where the uncertainty in the surface is examined, through the construction of a variability interval. This applies when |
The interactive controls allow the surface to be plotted using image
or persp
displays, and with the display of uncertainty through mouse click and drag on the image
plot or animation.
Nothing is returned.
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
## Not run: if (require(sm)) { with(trawl, { location <- cbind(Longitude, Latitude) model <- sm.regression(location, Score1, ngrid = 15, display = "none") longitude <- model$eval.points[ , 1] latitude <- model$eval.points[ , 2] xgrid <- as.matrix(expand.grid(longitude, latitude)) S <- sm.weight2(location, xgrid, model$h) covar <- tcrossprod(S) * model$sigma^2 rp.surface(model$estimate, covar, longitude, latitude, location, Score1) }) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.