| process_uploaded_data | R Documentation |
The Import tab's core transform: renames the user's chosen date/value
columns to ds/y, aggregates individual-observation data into periods,
and optionally normalizes by a population table to produce incidence
rather than absolute counts.
process_uploaded_data(
data,
type = c("agg", "individual"),
date_col,
value_col = NULL,
group_col = NULL,
pop_df = NULL,
pop_date_col = NULL,
pop_value_col = NULL,
pop_group_col = NULL,
unit_divisor = 1,
pop_multiplier = 1,
date_agg = "day",
pop_freq = "year"
)
data |
A data frame – the uploaded main dataset. |
type |
|
date_col |
Character scalar, the name of |
value_col |
Character scalar, the name of |
group_col |
Optional character scalar, a grouping column (e.g.
District) to carry through untouched alongside |
pop_df |
Optional population data frame for normalization. |
pop_date_col, pop_value_col |
Character scalars naming |
pop_group_col |
Optional character scalar, |
unit_divisor, pop_multiplier |
Numeric scaling applied to the
population figure (e.g. |
date_agg |
Aggregation frequency: one of |
pop_freq |
Whether |
A tibble with columns ds, y, and group_col if supplied.
df <- data.frame(when = as.Date("2024-01-01") + 0:9, count = 1:10)
process_uploaded_data(df, type = "agg", date_col = "when", value_col = "count")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.