calc_n_sites: Calculate number of unique SiteIDs per epiweek

Description Usage Arguments Value Examples

View source: R/TURN.R

Description

Given daily site level data, calculate the number of unique SiteIDs for each epiweek.

Usage

1
calc_n_sites(df, group_vars = NULL, window = 3)

Arguments

df

This is a dataframe containing daily test utilization data must have columns of "daily_TUR_rp","SiteID", "date", as well as columns to group by

group_vars

columns to group by (e.g. region). Unquoted names of columns enclosed in vars(), or NULL

window

Width (in weeks) of window over which to count how many sites are present.

Value

dataframe with SiteID, date, epiweek, epiyear, epidate, n_sites (number of sites that week), and other grouping variables

Examples

1
2
3
# see ?TUR_dat
calc_n_sites(TUR_dat)
calc_n_sites(TUR_dat, group_vars = vars(InstrumentVersion))

MartinHoldrege/turnr documentation built on May 16, 2020, 10:39 a.m.