y: numeric; the data the density of which we want.
n: integer; the number of abscissa values for density evaluation (and plotting).
log.bw: logical; if true (default), the gui scrollbar is on a log bandwidth scale, otherwise, simple interval.
showvalue: logical; if true, the value of the current (log) bandwidth is shown on top of the scrollbar.
xlim: initial xlim for plotting, see plot.default.
do.rug: logical indicating if rug(y) should be added to each plot. This is too slow for really large sample sizes.
kernels: character vector of kernel names as allowable for the kernels argument of the standard density function.
from.f, to.f: numeric giving the left and right limit of the bandwidth scrollbar.
col: color to be used for the density curve.
Details
library(tcltk) must be working, i.e., Tcl/Tk must have been installed on your platform, and must have been visible during 's configuration and/or installation.
You can not only choose the bandwidth (the most important parameter), but also the kernel, and you can zoom in and out (in x-range only).
Returns
none.
(How could this be done? tcltk widgets run as separate processes!)
Author(s)
Martin Maechler, building on demo(tkdensity).
Examples
if(dev.interactive(TRUE))## does really not make sense otherwiseif(try(require("tcltk"))){## sometimes (rarely) there, but broken data(faithful) tkdensity(faithful $ eruptions) set.seed(7)if(require("nor1mix")) tkdensity(rnorMix(1000, MW.nm9), kernels = c("gaussian","epanechnikov"))}