R/add_boundary_box.R
add_boundary_box.Rd
This function adds a bounding box around observations on a plot at specified coordinates.
add_boundary_box(x, ...)
x | A vector of length four which specifies (1) the minimum x value of the box; (2) the maximum x value of the box; (3) the minimum y value of the box; and (4) the maximum y value of the box. |
---|---|
... | Other arguments passed to |
This is a simple wrapper for rect
.
The function adds a rectangular box around observations at specified coordinates.
Edward Lavender
# Simulate some observations x <- runif(100, 0, 1) y <- runif(100, 10, 20) # Visualise observations and a boundary box around the range of the values # ... and the 0.05 0.95 quantiles: plot(x, y)add_boundary_box(c(stats::quantile(x, prob = c(0.05, 0.95)), stats::quantile(y, prob = c(0.05, 0.95))), border = "red", lty = 3)