desc_Cmed: Cmed

View source: R/desc-cases.R

desc_CmedR Documentation

Cmed

Description

Median duration in consecutive weeks with at least 'x' cases.

Usage

desc_Cmed(df, x)

Arguments

df

A data.frame with a numeric 'cases' column.

x

Number of cases.

Details

This function is designed to be called by desc_year on data that has already been split into a single epidemiological year for a single spatial unit. Using it directly outside of that context is not recommended, as no input validation is performed.

Value

The computed Cmed epidescriptor.

Examples

# Single spatial unit and epidemiological year
oneyear <- dengueRio[dengueRio$muni_code == 330455, ]
oneyear$time <- epiyearweek(oneyear$date)
oneyear <- oneyear[substr(oneyear$time, 1, 4) == "2019", ]
desc_Cmed(oneyear, 50)

epidesc documentation built on Aug. 8, 2026, 1:06 a.m.