| 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 confidence interval structure. The function allows flexible grouping, species filtering, and visualization either as faceted plots or separate panels.
The function is designed to be compatible with outputs from different estimation functions within the package (e.g., para_abundance_CI, para_intensity_CI, para_prevalence_CI). Automatic detection of confidence intervals ensures flexibility across workflows. Interpretation of graphical outputs remains the responsibility of the user.
It automatically detects:
para_plot_CI(para_data, group_vars, sp_cols = NULL, descriptor = NULL,
lower_ci = NULL, upper_ci = NULL, point_color = "blue", line_size = 1,
point_size = 3, n_cols = 1, include_zeros = TRUE, separate_plots = FALSE)
para_data |
Data frame containing parasitological descriptors and confidence intervals estimated with one 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 |
lower_ci |
Optional names of the columns containing the lower confidence. If |
upper_ci |
Optional names of the columns containing the upper confidence. If |
point_color |
Color of the points. Default is |
line_size |
Line width of the confidence interval 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 |
The response variable to be plotted.
The structure of confidence intervals, 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")
When multiple grouping variables are provided in x_var, they are combined into a single factor for visualization. Confidence intervals 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.
A ggplot object or a list of ggplot objects representing the estimated values and their confidence intervals.
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.