Description Usage Arguments Value Examples
Due to the event loop structure of tcltk, this only works in the GTK toolkit at the moment.
1 | manipulate(._expr, ...)
|
._expr |
expression to produce output. |
... |
used to specify controls. See |
makes output, returns Animanipulate object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
manipulate(## expression
{
size <- sqrt.size^2
y <- get(distribution)(size)
plot(density(y, bw = bandwidth/100, kernel=kernel),
axes = axes, ann = label,
main = paste("kernel:", kernel))
points(y, rep(0, size))
},
## controls
distribution = picker("rnorm", "rexp"),
kernel = picker("gaussian", "epanechnikov",
"rectangular", "triangular", "cosine"),
sqrt.size = slider(5, 30, step = 1, init = 10),
bandwidth = slider(5, 200, step = 5, init = 100,
label = "bandwith [%]"), # using % here b/c some toolkits only allow integers (GTK is fine with real)
axes = checkbox(TRUE, label="Draw Axes"),
label = checkbox(TRUE, label="Draw Labels")
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.