Learn R Programming

NHSRwaitinglist (version 0.1.2)

wl_join: Join two waiting list

Description

Take two waiting list and sorting in date order

Usage

wl_join(wl_1, wl_2, referral_index = 1)

Value

A data.frame representing the combined waiting list, created by joining wl_1 and wl_2. The result is sorted by the referral date column specified by referral_index. The column structure is preserved from the input data frames.

Arguments

wl_1

a waiting list: dataframe consisting addition and removal dates

wl_2

a waiting list: dataframe consisting addition and removal dates

referral_index

the column index where referrals are listed

Examples

Run this code

referrals <- c.Date("2024-01-01","2024-01-04","2024-01-10","2024-01-16")
removals <- c.Date("2024-01-08",NA,NA,NA)
wl_1 <- data.frame("referral" = referrals ,"removal" = removals )

referrals <- c.Date("2024-01-04","2024-01-05","2024-01-16","2024-01-25")
removals <- c.Date("2024-01-09",NA,"2024-01-19",NA)
wl_2 <- data.frame("referral" = referrals ,"removal" = removals )
wl_join(wl_1,wl_2)

Run the code above in your browser using DataLab