cstidy puts aggregated disease-surveillance counts into one standard panel format, and derives the time and geography columns that format needs. Give it a table with a time column and a location_code. You get back the same table with isoyear, isoweek, season, seasonweek, date and the granularity columns filled in. It does not aggregate individual-level records — aggregate first, then use cstidy.
cstidy is built by Core Surveillance, a team at the Norwegian Institute of Public Health (NIPH; Folkehelseinstituttet, FHI), alongside cstime, csdata, csalert and csstyle. The cs prefix is Core Surveillance; the format class csfmt_rts_data_v3 is core surveillance format, real-time surveillance data, version 3. Defaults follow NIPH convention — a surveillance season runs from ISO week 35 to ISO week 34, and geography codes are Norwegian.
Features
Standard data format
Apply set_csfmt_rts_data_v3() for the slim weekly format. Apply set_csfmt_rts_data_v2() for the older format, which derives 18 unified columns and also covers daily and yearly data.
Smart assignment
Assigning isoyear, isoyearweek, date, or location_code with := automatically re-derives all dependent time and geography columns.
Panel inspection
Check completeness with unique_time_series(), extend to a future time point with expand_time_to(), and plot column structure with identify_data_structure().
