Skip to contents

Calculates queue sizes from a waiting list

Usage

wl_queue_size(waiting_list, start_date = NULL, end_date = NULL)

Arguments

waiting_list

dataframe consisting addition and removal dates

start_date

start of calculation period

end_date

end of calculation period

Value

a list of dates and queue sizes

Examples

referrals <- c.Date("2024-01-01", "2024-01-04", "2024-01-10", "2024-01-16")
removals <- c.Date("2024-01-08", NA, NA, NA)
waiting_list <- data.frame("referral" = referrals, "removal" = removals)
wl_queue_size(waiting_list)
#>         dates queue_size
#> 1  2024-01-01          1
#> 2  2024-01-02          1
#> 3  2024-01-03          1
#> 4  2024-01-04          2
#> 5  2024-01-05          2
#> 6  2024-01-06          2
#> 7  2024-01-07          2
#> 8  2024-01-08          1
#> 9  2024-01-09          1
#> 10 2024-01-10          2
#> 11 2024-01-11          2
#> 12 2024-01-12          2
#> 13 2024-01-13          2
#> 14 2024-01-14          2
#> 15 2024-01-15          2
#> 16 2024-01-16          3