Integration of R into wikis - Interaction

From SlideWiki

Jump to: navigation, search
|< <<  >> >| 
Integration of R into wikis: About - ZWiki - MediaWiki - Outlook
StatWiki - Raw Output - HTML - Graphics - Interaction - Further plugins
<Rform name="binom">
n: <input name="n" type="text" size="5" maxlength="5" value="10"> 
prob: <input name="prob" type="text" size="5" maxlength="5" value="0.2"> 
<input type="submit" value=" Submit "> (You may need to reload the iframe below after submitting).
<R output="display" name="binom" iframe="height:400px;">
if (exists("prob")) prob <- as.numeric(prob) else prob <- 0.2
if (exists("n")) n <- as.numeric(n) else n <- 10
x <- seq(0, n, 1)
p <- dbinom(x, n, prob)
param <- list(n, prob)
main <- c("Binomialverteilung - Wahrscheinlichkeitsfunktion", paste (c("Stichprobenumfang n", "Wahrscheinlichkeit p"), param, sep="="))
pdf(rpdf, width=5, height=5)
plot(x,p, type="h", main=main)

n:  prob:  

Personal tools