View source: R/plot_boot_vec.R
plot_boot_vec | R Documentation |
Plot median values and confidence intervals (shaded region) for stochastic (e.g. bootstrapped) vectors.
plot_boot_vec(
data,
CIpct = 95,
runsToKeep = NULL,
ref_x = NULL,
ref_y = NULL,
col_lines = rgb(0, 0, 0, 1),
add = FALSE,
plot_shade = TRUE,
plot_medCI = TRUE,
plot_runs_which = "none",
plot_runs_args = list(type = "l", lty = 1),
plot_runs_col_fn = rainbow,
plot_runs_labels = NULL,
plot_runs_labels_args = list(pos = 4, cex = 1),
plot_runs_endpt_args = list(),
polygon_args = list(),
plot_legend = FALSE,
legend_args = list(),
...
)
data |
a numeric matrix or data frame that can be coerced to a numeric matrix where rows are runs and columns represent a numeric sequence (e.g. age, year). Note that the function would probably work for any numeric matrix, but it's intended for bootstrapped time- or age-series data. |
CIpct |
percentage to define the range of the confidence intervals to plot |
runsToKeep |
optional vector of integer values corresponding to the rows of |
ref_x , ref_y |
x and y vectors for adding a reference line to the plot (e.g. base run values) |
col_lines |
color for lines depicting central tendency and confidence limits. Expects hex color |
add |
logical. Should a new plot be drawn (FALSE) or should it be added to an existing plot (TRUE)? |
plot_runs_which |
Specify individual runs to add to the plot: "none" add none of the individual runs, "all" adds all of the runs. Or specify a numeric vector of the runs you want to plot, corresponding to columns of |
plot_runs_args |
list of arguments to pass to |
plot_runs_col_fn |
name of the color function to use when adding runs to plot. It should be a function like |
plot_runs_labels |
character vector of labels for runs to plot. Length should be equal to the number of individual runs being plotted |
plot_runs_labels_args |
arguments to pass to |
plot_runs_endpt_args |
arguments to pass to |
polygon_args |
Optional arguments to pass to |
plot_legend |
logical. Should a legend be added to the plot? If TRUE, legend_args can be specified to format the legend. |
legend_args |
Optional arguments to pass to |
... |
other arguments to pass to |
Nikolai Klibansky
## Not run:
bootData <- t(replicate(n=200,random_walk(x=1:200,mu=0.1)))
plot_boot_vec(bootData)
plot_boot_vec(bootData,plot_runs_which = sample(1:nrow(bootData),10))
plot_boot_vec(bootData,plot_runs_which = sample(1:nrow(bootData),10),plot_shade=FALSE)
plot_boot_vec(bootData,plot_runs_which = sample(1:nrow(bootData),10),plot_shade=FALSE,plot_medCI = FALSE)
ids <- sample(1:nrow(bootData),10)
plot_boot_vec(bootData,plot_runs_which = ids,plot_shade=FALSE,plot_medCI = FALSE,
plot_runs_labels=ids,plot_runs_labels_args = list(pos=4,cex=0.75))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.