R Handle of The Humanitarian Emergency Settings Perceived Needs Scale (HESPER)
The development version can be installed from GitHub with:
pak::pak("gnoblet/hespeR")hespeR provides tools for handling, cleaning, and analyzing HESPER
survey data in R. It includes classes for representing HESPER data,
functions for checking and validating datasets, and utilities for common
wrangling tasks.
- Core Classes:
HesperList,HesperListEnhanced,HesperVectorfor structured data handling.
- Validation Functions:
check_missing_vars,check_values_in_set,check_vars_in_set,check_vecs_in_set,check_vector_class,check_dupes
- Options and Variables:
hesper_opts,hesper_vars,rec_hesper_opts
- Messages:
msg_invalid_values,msg_missing_vars
- Data Utilities:
- Functions for wrangling and cleaning HESPER data.
library(hespeR)
# Example: Check for missing variables in a data frame
result <- check_missing_vars(df, required_vars = c("hesper_item1", "hesper_item2"))
print(result)See the vignette for a full workflow example:
vignette("hesper_class", package = "hespeR")
Example data and templates are available in the resources/ folder: -
hesper_key.xlsx - template_tool_hh.xlsx -
template_tool_individual_level.xlsx
- The package includes comprehensive tests (
tests/testthat/) and uses roxytypes for type-safe documentation. - Documentation is available via
?function_namein R.
- ☐ Composition of needed columns
- ☐ Data cleaning
- ☐ Analyses and visualization
- ☐ Publication (reports, presentations)
All steps will include documentation and tests.
We welcome contributions! Please see the Minimum Viable Good Practices for High Quality Statistical Software Packages for guidance.