inst/examples/R/stat/Quantil/Lampen.R

par(mfrow=c(1,2))
gl <- read.csv("gluehlampen.csv")
barplot(gl$f_hat, names = rep("", length(gl$f_hat)), las=2,
        width = (gl$k_o - gl$k_u), space = 0, col="white", axes = FALSE)
axis(1, at =c(1:2500), labels = rep("",2500) ,lty = 0, xpd = TRUE)
axis(2, at = c(0:9), labels = rep("",10), pos = 0, xpd = TRUE, tck = 0)
rect(500, 0, 666.67, 9, col = "grey")
rect(100, 0, 500, 6, col = "grey")
rect(0, 0, 100, 3, col = "grey")
points(0, 9, pch =17, xpd = TRUE)
lines(x = c(666.67,666.67), y = c(0,9), lty=1, lwd = 3)
text(x = 666.67, y = -0.5, labels=expression(x[p]), xpd = TRUE)
text(x = -80, y = 9, labels=expression(hat("f(x)")), xpd = TRUE)
F_hat = c(0, 1, 7, 16, 19, 19)
plot(c(gl$k_u, gl$k_o[4], 2500), F_hat, type = "l", axes = FALSE, ylab = "",
     xlab = "", xpd = TRUE, lwd = 3)
axis(1, at =c(1:2500), labels = rep("",2500), xpd = TRUE, tck = 0, pos = 0)
axis(2, at = c(0:21), labels = rep("",22), pos = 0, xpd = TRUE, tck = 0)
points(0, 21, pch =17, xpd = TRUE)
text(x = 666.67, y = -1, labels=expression(x[p]), xpd = TRUE)
text(x = 2500, y = -1, labels="x", xpd = TRUE)
text(x = -80, y = 22, labels= expression(hat("F(x)")), xpd = TRUE)
text(x = -80, y = 10, labels= "p", xpd = TRUE)
text(x = -80, y = 19, labels= "1", xpd = TRUE)
lines(x = c(666.67,666.67), y = c(0, 10), lty=2)
lines(x = c(0,666.67), y = c(10, 10), lty=2)
lines(x = c(0,2500), y = c(19, 19), lty=2, xpd = TRUE)
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.