Pre-process WorldFish Zanzibar Gleaning Surveys
preprocess_wf_gleaning.RdDownloads raw structured gleaning survey data from cloud storage and preprocesses it into a single analysis-ready data frame. The function assembles three pieces and joins them on the submission:
General info – strips the Kobo group prefixes (
group_general/,group_trip/,no_fishers/,demographics/,group_gleaning_activity/,group_supply_chain/), selects and renames the trip, demographic, activity and supply-chain fields, coalesces the conditionallanding_sitecolumns into one, and coerces dates and numeric fields.Catch info – reshapes the wide
group_catchblock into a tidy long table (one row per submission x shell group x size class) viareshape_gleaning_catch, unifying the parallel bucket/plastic container fields and applying conservative sanitisation.Catch totals – per submission, sums individuals across size classes (
total_individuals) and reconstructs catch weight asunit_weight_kg * n_containers(total_catch_kg); the container fields are constant within a submission, hencefirst().
Usage
preprocess_wf_gleaning(log_threshold = logger::DEBUG)Arguments
- log_threshold
Logging threshold level (default:
logger::DEBUG).
Value
A data frame of preprocessed gleaning surveys: one row per
submission x shell group x size class, with general/demographic/activity/
supply-chain fields plus total_individuals and total_catch_kg.