Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_data_type(), a data type detection function for severity pipeline #163

Open
wants to merge 3 commits into
base: who_epiverse
Choose a base branch
from

Conversation

Attalowe
Copy link

@Attalowe Attalowe commented Mar 5, 2025

Purpose

This PR adds get_data_type(), a utility function to automatically classify input data for severity analyses. It supports:

  • Count data (via total_count/total_death arguments)
  • incidence-class objects
  • Linelist/incidence data frames
  • Error handling for unrecognized formats

Changes

  • New function in R/get_data_type.R
  • Case-insensitive column name checks
  • Validation logic for required columns (date, cases, dead)
  • Linelist keyword matching (e.g., "id", "onset", "outcome")
  • Roxygen2 documentation with other files (to be push later)

Testing

  • Includes validation for:
    • Count data detection
    • incidence object handling
    • Data frame type classification (linelist vs. incidence)
    • Error cases

Notes

  • usethis and devtools was use.

Attalowe added 3 commits March 5, 2025 15:51
- Add `get_data_type()` to automatically classify input data as "count_data",
  "incidence", or "linelist" based on
 structure/columns
- Checks for count data via `total_count`/`total_death` arguments
- Identifies `incidence` class objects
- Validates data frames against required columns (`date`, `cases`, `dead`)
  and linelist keywords (e.g., "id", "onset", "outcome")
- Implements case-insensitive column name matching
- Includes error handling for unrecognized formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant