Skip to contents

Get wastewater data indices

Usage

get_ww_data_indices(
  ww_data,
  first_count_data_date,
  owt,
  lod_col_name = "below_lod"
)

Arguments

ww_data

Input wastewater dataframe containing one row per observation, with outliers already removed

first_count_data_date

The earliest day with an observation in the ' count dataset, in ISO8601 format YYYY-MM-DD

owt

number of wastewater observations

lod_col_name

A string representing the name of the column in the input_ww_data that provides a 0 if the data point is not above the LOD and a 1 if the data is below the LOD, default value is below_LOD

Value

A list containing the necessary vectors of indices that the stan model requires: ww_censored: the vector of time points that the wastewater observations are censored (below the LOD) in order of the date and the site index ww_uncensored: the vector of time points that the wastewater observations are uncensored (above the LOD) in order of the date and the site index ww_sampled_times: the vector of time points that the wastewater observations are passed in in log_conc in order of the date and the site index ww_sampled_sites: the vector of sites that correspond to the observations passed in in log_conc in order of the date and the site index ww_sampled_lab_sites: the vector of unique combinations of site and labs that correspond to the observations passed in in log_conc in order of the date and the site index lab_site_to_site_map: the vector of sites that correspond to each lab-site