Configures variable-specific parameters and applies necessary transformations to the dataset based on the variable of interest. This includes defining numerator/denominator columns, computing derived metrics when needed, filtering, and restructuring the repository.

set_var_params(varname, repo)

Arguments

varname

A string specifying the variable to analyze. Supported values: `"parous_rate"`, `"endophagy"`, `"endophily"`, `"indoor_HBI"`, `"outdoor_HBI"`, `"sac_rate"`, `"HBI"`.

repo

A `data.frame` containing the repository data to process.

Value

A named list containing:

nice_varname

Human-readable name for the variable

denominator_variables

Name of the denominator column

numerator_variables

Name of the numerator column

percentage_variables

Name of the percentage column (or NULL if not applicable)

remove_unknown_insecticide

Logical flag indicating whether to exclude unknown insecticide data

repo

(Optional) Transformed repository data.frame for HBI and other derived variables