-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwl_schedule.Rd
executable file
·44 lines (40 loc) · 1.3 KB
/
wl_schedule.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wl_schedule.R
\name{wl_schedule}
\alias{wl_schedule}
\title{A simple operation scheduler}
\usage{
wl_schedule(
waiting_list,
schedule,
referral_index = 1,
removal_index = 2,
unscheduled = FALSE
)
}
\arguments{
\item{waiting_list}{dataframe. A df of referral dates and removals}
\item{schedule}{vector of dates. The dates to schedule open referrals into
(ie. dates of unbooked future capacity)}
\item{referral_index}{integer. The column number in the waiting_list which
contains the referral dates}
\item{removal_index}{integer. The column number in the waiting_list which
contains the removal dates}
}
\value{
dataframe. A df of the updated waiting list with removal dates added
according to the schedule
}
\description{
Takes a list of dates and schedules them to a waiting list,
by adding a removal date to the dataframe.
This is done in referral date order,
I.e. earlier referrals are scheduled first (FIFO).
}
\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)
schedule <- c.Date("2024-01-03", "2024-01-05", "2024-01-18")
updated_waiting_list <- wl_schedule(waiting_list, schedule)
}