create_epitrax_from_file
reads an EpiTrax data file and creates a structured object
containing the data along with commonly used metadata and empty report lists.
Value
An object of class epitrax
containing:
data
: The validated and formatted EpiTrax datadiseases
: Vector of unique diseases in the datasetyrs
: Vector of years in the datasetreport_year
: Most recent year in the datasetreport_month
: Most recent month in report_yearinternal_reports
: Empty list to store internal reportspublic_reports
: Empty list to store public reports
See also
read_epitrax_data()
which this function wraps and
setup_epitrax()
which wraps this function
Examples
if (FALSE) { # \dontrun{
# Interactive file chooser:
create_epitrax_from_file()
} # }
# Using sample data included with package
data_file <- system.file("sample_data/sample_epitrax_data.csv",
package = "epitraxr")
epitrax <- create_epitrax_from_file(data_file)
# Access components
head(epitrax$data)
#> disease month year counts
#> 1 Influenza 8 2020 1
#> 2 Influenza 12 2019 1
#> 3 Influenza 7 2021 1
#> 4 COVID-19 7 2024 1
#> 5 Influenza 6 2020 1
#> 6 Influenza 4 2022 1
epitrax$diseases
#> [1] "Influenza" "COVID-19" "Measles" "Chickenpox" "Syphilis"
epitrax$report_year
#> [1] 2024