Generate a Pie Chart of Observations by Species or Complex
obs_complex_species_pie.RdCreates an interactive pie chart showing the distribution of observations by species or species complexes, based on a specified observation variable from a pre-processed dataset. Optionally groups species with a small proportion of observations into an "Other" category, and can save the plot as an HTML file for sharing or embedding.
Arguments
- data
A list containing the following elements: - `data.req`: A data frame with observation data. Must contain a column named with the pattern `<varname>.den` (e.g., `"parous_rate.den"`). - `varname`: A character string indicating the base name of the observation variable. - `nice_varname`: A character string used for naming the saved output file.
- threshold_prop_other
A numeric value between 0 and 1 indicating the minimum proportion of total observations required for a species or complex to appear as its own slice in the pie chart. Species below this threshold are grouped under "Other". Default is 0.05 (5 percent).
- plot_dir
Optional. A character string giving the directory path where the HTML version of the pie chart should be saved. If `NULL`, the chart is not saved. Default is a specific folder on the user's system.