create_datareq.Rd
Prepares a dataset for proportion-based analysis by:
Removing rows with unknown insecticide intervention (if requested),
Renaming and standardizing column names,
Filtering out rows with missing numerators or denominators,
Warning when the numerator exceeds the denominator.
create_datareq(data.req, varname, remove_unknown_insecticide = TRUE)
A filtered and cleaned dataframe, excluding rows with missing denominators and (optionally) unknown insecticide interventions.
This function assumes that proportions have already been computed using
augment_withProportion_modif
, resulting in columns like `<varname>.num` and `<varname>.den`.
Additional processing steps:
The `species` column is renamed to `survey`.
Whitespace is removed from `insecticide_control` to create a new column `intervened`.
A warning is issued if any rows have `varname.num > varname.den`.
The total number of valid observations is printed.