####################################### plotCI <- function (x, y = NULL, uiw, liw = uiw, ..., sfrac = 0.01) { if (is.list(x)) { y <- x$y x <- x$x } if (is.null(y)) { if (is.null(x)) stop("both x and y NULL") y <- as.numeric(x) x <- seq(along = x) } ui <- y + uiw li <- y - liw plot(x, y, ylim = range(c(y, ui, li)), ...) smidge <- diff(par("usr")[1:2]) * sfrac segments(x, li, x, ui) x2 <- c(x, x) ul <- c(li, ui) segments(x2 - smidge, ul, x2 + smidge, ul) invisible(list(x = x, y = y)) } ## %%%%%%%%%%%%%%