Description Usage Arguments Details Value Author(s) Examples
Add interval symbols (also known as error bars) to plots.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
'numeric' or 'Date' vector. x coordinate of interval symbols. |
y0 |
'numeric' vector. y coordinate of points from which to draw. |
y1 |
'numeric' vector. y coordinate of points to which to draw. |
hin |
'numeric' number. Horizontal length of an interval head, in inches. |
col, lty, lwd, cex, xpd |
graphical parameters; see |
... |
Additional graphical parameters to the |
nondetects |
'list'.
Overrides graphical parameters used for left- and right-censored data.
Passed arguments include |
For each observation i
, the data type is identified using
(y0[i], Inf)
for right-censored,
y0[i] = y1[i]
for exact, and
(-Inf, y1[i])
for left-censored, and
(y0[i], y1[i])
for interval-censored.
Where infinity may be represented with either Inf
or NA
.
Invisible NULL
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.