Sums the total dead and censored across vials for each (day, condition) pair

sum_vials(df)

Arguments

df

A data.frame with 4 columns: day | condition | dead | censored. vial column is optional.

Value

A data.frame. All dead and censored values are summed across vials for each (day, condition) pair.

Examples


df <- tibble::tribble(
  ~day, ~condition, ~dead, ~censored, ~ vial,
  10,   "WT",       1,     0,         1,
  10,   "WT",       2,     0,         2,
  10,   "Drug1",    1,     0,         1,
  10,   "Drug1",    2,     0,         2,
  10,   "Drug2",    5,     0,         1,
  10,   "Drug1",    5,     0,         2,
  12,   "WT",       5,     0,         1,
  12,   "WT",       1,     0,         2,
  )