Two-dimensional kernel density estimation with an axis-aligned bivariate normal kernel
l_layer_density2d(
widget,
x,
y,
h,
n = 25L,
lims = NULL,
color = "black",
linewidth = 1,
nlevels = 10,
levels = NULL,
label = "density2d",
parent = "root",
index = 0,
group = NULL,
active = TRUE,
...
)an l_layer widget
`loon` widget path name as a string
The coordinates of x. See details
The coordinates of y. See details
vector of bandwidths for x and y directions. Defaults to
normal reference bandwidth (see bandwidth.nrd). A scalar
value will be taken to apply to both directions.
Number of grid points in each direction. Can be scalar or a length-2 integer vector.
The limits of the rectangle covered by the grid as c(xl, xu, yl, yu).
color of each contour
the line width
As described in grDevices::contourLines: number of
contour levels desired iff levels is not supplied.
As described in grDevices::contourLines: numeric vector
of levels at which to draw contour lines.
label used in the layers inspector
parent group layer
of the newly added layer in its parent group
separate x vector or y vector into a list by group
a logical determining whether points appear or not (default is TRUE for all points).
If a logical vector is given of length equal to the number of points,
then it identifies which points appear (TRUE) and which do not (FALSE).
other arguments to modify l_layer_line.
if(interactive()) {
p <- l_plot(iris, color = iris$Species)
l <- l_layer_density2d(p)
}
Run the code above in your browser using DataLab