check_reports_valid: Validate data input

View source: R/checks.R

check_reports_validR Documentation

Validate data input

Description

check_reports_valid() checks that the supplied data is a ⁠<data.frame>⁠, and that it has the right column names and types. In particular, it checks that the date column is in date format and does not contain NA's, and that the other columns are numeric.

Usage

check_reports_valid(
  data,
  model = c("estimate_infections", "estimate_truncation", "estimate_secondary")
)

Arguments

data

A data frame with either:

  • a minimum of two columns: date and confirm, if to be used by estimate_infections() or estimate_truncation(), or

  • a minimum of three columns: date, primary, and secondary, if to be used by estimate_secondary().

model

The EpiNow2 model to be used. Either "estimate_infections", "estimate_truncation", or "estimate_secondary". This is used to determine which checks to perform on the data input.

Value

Called for its side effects.


epiforecasts/EpiNow2 documentation built on April 27, 2024, 9:15 p.m.