Description Usage Arguments Details Value Author(s) References See Also Examples
The functions slider.hist
and slider.density
compute histograms and density traces
whereas some parameter are controlled by sliders.
slider.hist
computes a histogram; the number of classes is
defined by a slider.
slider.density
computes a density trace; width and
type of the kernel are defined by sliders.
1 2 | slider.hist(x, panel, ...)
slider.density(x, panel, ...)
|
x |
data set to be used for plotting |
panel |
function constructing additional graphical elements to the plot |
... |
additional (graphics) parameters which are passed to the invoked high level plotting function |
slider.hist
draws a histogram of the data set x
by
calling hist
and opens a Tcl/Tk widget with one slider.
The slider defines the number of classes of the histogram. Changing the
slider results in redrawing of the plot. For further
details see the help page of hist
. rug
is used as the
default panel function.
slider.density
draws a density trace of the data set x
by plot(density(...))
and opens a Tcl/Tk-widget with two
sliders. The first slider defines the width of the density trace
and the second one the kernel function:
"1-gaussian", "2-epanechnikov", "3-rectangular",
"4-triangular","5-biweight", "6-cosine", "7-optcosine"
Changing one of the sliders results in a redrawing of the plot.
For further details see the help page of density
.
rug
is used as the default panel function.
a message about the usage
Hans Peter Wolf
~~
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
## This example cannot be run by examples() but should be work in an interactive R session
slider.hist(log(islands))
## End(Not run)
## Not run:
## This example cannot be run by examples() but should be work in an interactive R session
slider.density(rivers,xlab="rivers",col="red")
## End(Not run)
## Not run:
## This example cannot be run by examples() but should be work in an interactive R session
slider.density(log(rivers),xlab="rivers",col="red",
panel=function(x){
xx<-seq(min(x),max(x),length=100)
yy<-dnorm(xx,mean(x),sd(x))
lines(xx,yy)
rug(x)
print(summary(yy))
}
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.