| plot_trend | R Documentation |
Visualizes posterior trends from a birp object by plotting the median and quantile intervals of the estimated relative densities over time. Optionally, vertical lines can be added to mark epoch boundaries and survey timepoints.
plot_trend(
x,
CI_group = 1,
n_points = 1000,
quantiles = c(0.99, 0.9, 0.5, 0.25),
quantile.col = gray(seq(1, 0, length.out = length(quantiles) + 2)[2:(length(quantiles)
+ 1)]),
quantile.border = NA,
median.col = "deeppink",
median.lwd = 2,
median.lty = 1,
epoch.col = "black",
epoch.lwd = 1,
epoch.lty = 1,
times.col = "black",
times.lwd = 1,
times.lty = 2,
log = FALSE,
xlab = "Time",
ylab = paste(c("log", "Relative Density")[c(log, TRUE)], collapse = " "),
main = x$CI_groups[CI_group],
...
)
x |
A |
CI_group |
Integer; Index of the control-intervention group to plot. Default is 1. |
n_points |
Integer; Number of points to evaluate the trend over time. Default is 1000. |
quantiles |
Numeric vector; Quantiles to plot as shaded intervals. Must be in (0, 1). Default is c(0.99, 0.9, 0.5, 0.25). |
quantile.col |
Character vector or color values; Fill colors for quantile polygons. Default is shades of gray. |
quantile.border |
Character or NA; Border color for quantile polygons. Use NA to omit borders. Default is NA. |
median.col |
Character; Color of the median trend line. Default is "deeppink". |
median.lwd |
Numeric; Line width for the median trend. Default is 1. |
median.lty |
Numeric or character; Line type for the median trend line. Default is 1 (solid). |
epoch.col |
Character or color specification; Color for lines representing epoch boundaries. Default is |
epoch.lwd |
Numeric; Line width for epoch boundary lines. Default is 1. |
epoch.lty |
Numeric or character; Line type for epoch boundary lines. Default is 1 (solid). |
times.col |
Character or color specification; Color for vertical lines representing measurement times. Default is |
times.lwd |
Numeric; Line width for measurement time lines. Default is 1. |
times.lty |
Numeric or character scalar; Line type for measurement time lines. Default is 2 (dashed). |
log |
Logical; If |
xlab |
Character; Label for the x-axis. Default is |
ylab |
Character; Label for the y-axis. Default dynamically set to either |
main |
Character; Main title of the plot. Defaults to the name of the selected CI group. |
... |
Additional graphical parameters passed to the base |
No return value, called for side effects.
birp
data <- simulate_birp()
est <- birp(data)
plot_trend(est)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.