The densities of two continuous variables is first computed using the density
function from package stats
. The outer product of the two densities is computed, which can be plotted as a contour map or a perspective plot.
plotDensity3d.fnc(x, y, plot.type = "contour", color = "terrain",
xlab = NULL, ylab = NULL, zlab = NULL, main = NULL, cex = 1,
lit = TRUE, theta = 0, phi = 0, bw = "nrd0", adjust = 1, kernel = c("gaussian",
"epanechnikov", "rectangular", "triangular", "biweight", "cosine",
"optcosine"), weights = NULL, window = kernel, width, give.Rkern = FALSE,
n = 50, from, to, cut = 3, na.rm = FALSE, ...)
Numeric vectors.
The type of plot to make. Can be any of "contour"
(default) or "persp"
.
The colour scheme to use for plots. One of ``topo
'', ``heat
'', ``cm
'', ``terrain
'', ``gray
'' or ``bw
''. Schemes ``gray
'' and ``bw
'' also modify the colors used.
Titles for the axes. N.B. These must be character strings; expressions are not accepted. Numbers will be coerced to character strings.
The main title on top of the plot.
The size of label and main text.
Logical, specifying if lighting calculation should take place on geometry.
Angle defining the viewing direction. theta
gives the azimuthal direction. Used only if plot.type = "persp"
.
Angle defining the viewing direction. phi
gives the colatitude. Used only if plot.type = "persp"
.
See help page to function density
.
Further arguments passed to functions image
, contour
or persp
.
Either a contour map or a perspective plot. Invisibly returns
The numeric vector supplied in argument x
.
The numeric vector supplied in argument y
.
The density object tied to vector x
.
The density object tied to vector y
.
The outer product of the x
and y
densities in matrix format.
The color used for plotting.
See help page to the density
function.
# NOT RUN {
# see example in LMERConvenienceFunctions help page.
# }
Run the code above in your browser using DataLab