| para_plot_CI | R Documentation |
This function generates graphical representations of parasitological estimates (abundance, intensity, or prevalence) including their associated confidence intervals. It supports multiple input formats and automatically detects the response variable and CI structure. The function allows flexible grouping, species filtering, and visualization either as faceted plots or separate panels.
The input must be the direct, unmodified output returned by one of the compatible CI functions (e.g., para_abundance_CI, para_intensity_CI, para_prevalence_CI) to ensure proper automatic detection of CIs.
Manually renamed, summarized, reshaped, or otherwise restructured tables are not supported, as the function relies on the original descriptor and CI columns to automatically identify the estimates and plot the associated uncertainty.
It automatically detects:
para_plot_CI(para_df, group_vars, sp_cols = NULL, descriptor = NULL,
point_color = "blue", line_size = 1, point_size = 3, n_cols = 1,
include_zeros = TRUE, separate_plots = FALSE, save_fig = "none",
verbose = FALSE)
para_df |
Data frame returned directly and without modification of the following functions: |
group_vars |
Character vector specifying the variable(s) to be used on the x-axis. Multiple variables will be combined. |
sp_cols |
Optional vector of parasite taxa to include in the plot. Default is |
descriptor |
Name of the variable to be plotted on the y-axis. If |
point_color |
Color of the points. Default is |
line_size |
Line width of the CI bars. Default is |
point_size |
Size of the points. Default is |
n_cols |
Number of columns used in faceted plots. Default is |
include_zeros |
Logical. If |
separate_plots |
Logical. If |
save_fig |
Character string indicating the file format used to export the plot in the current working directory. Valid options are |
verbose |
Logical. If |
The response variable to be plotted.
The structure of CIs, including:
Separate columns (Lower_CI, Upper_CI)
Method-specific intervals (e.g., exact or Blaker)
Combined intervals stored as a single character column (e.g., "min - max")
Aggregation outputs contain multiple descriptors (e.g., VMR, mean crowding, patchiness, Poulin's D, Hoover index, and k). If descriptor is not specified, para_plot_CI() automatically plots the variance-to-mean ratio (VMR). To visualize any other aggregation index, the corresponding descriptor must be explicitly provided (e.g., descriptor = "poulin_D").
When multiple grouping variables are provided in x_var, they are combined into a single factor for visualization. CIs are displayed as vertical error bars, and point estimates are overlaid. When multiple parasite taxa are present, results are displayed using faceting or as separate plots. Interpretation of graphical outputs remains the responsibility of the user.
A ggplot object or a list of ggplot objects representing the estimated values and their CIs.
Juan Manuel Cabrera, Exequiel Furlan and Elisa Helman
Bush, A.O., Lafferty, K.D., Lotz, J.M., Shostak, A.W. (1997). Parasitology meets ecology on its own terms: Margolis revisited. Journal of Parasitology, 83(4), 575–583.
Reiczigel, J., Marozzi, M., Fabian, I., Rózsa, L. (2019). Biostatistics for parasitologists – a primer to quantitative parasitology. Trends in Parasitology, 35(4), 277–281.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.