# NOT RUN {
set.seed(1)
x <- stats::runif(12)
y <- stats::rnorm(12)
plot(x, y)
dy <- sort.int(y) / 5
AddIntervals(x, y - dy, y + dy, col = "red", xpd = TRUE)
n <- 50
x <- sort.int(stats::runif(n, max = 100))
y1 <- y0 <- stats::runif(n, max = 100)
y1[sample.int(n, 5)] <- stats::runif(5, max = 100)
y0[sample.int(n, 5)] <- -Inf
y1[sample.int(n, 5)] <- Inf
ylim <- range(pretty(c(y0, y1)))
plot(NA, xlim = range(x), ylim = ylim, xlab = "x", ylab = "y")
AddIntervals(x, y0, y1, col = "blue", xpd = TRUE,
nondetects = list("col" = "red", "lty" = 2))
print(cbind(x, y0, y1))
# }
Run the code above in your browser using DataLab