Description Usage Arguments Details Examples
2d dernel density estimate.
1 2 | kernel_density_2d(x, y, weight, xbandwidth="bw.nrd",
ybandwidth="bw.nrd", na.rm=FALSE)
|
x |
a numeric vector of x positions |
y |
a numeric vector of y positions |
weight |
|
xbandwidth |
bandwith for x direction. Either a number or a function to calculate the binwidth from the data. |
ybandwidth |
bandwith for y direction. Either a number or a function to calculate the binwidth from the data. |
na.rm |
If |
Only normal kernel/weight function currently implemented.
This function is based on kde2d
but
extended to allow weights, and to compute density at
arbitrary position.
1 2 3 | data(baseball, package = "plyr")
dens <- kernel_density_2d(baseball$g, baseball$ab)
plot(dens)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.