add_subject_context: add subject context

View source: R/mungers.R

add_subject_contextR Documentation

add subject context

Description

@description [Maturing]

Usage

add_subject_context(d)

Arguments

d

data frame, as specified above

Details

Requires a data frame with the subject (six character code), n_remained (if this is NA the subject wasn't in HEPPP last year), genuine_pass_rate, n_passed, same_trigger (boolean) and also three fields describing when the subject runs, s1, s2 and s3. The sn fields should be set to internal, distance or both. If they are all blank (NA) then it is deemed that it is unknown when the subject is run next.

Examples

d <- tibble::tribble(
   ~subject, ~genuine_pass_rate, ~n_remained, ~n_passed, ~same_trigger, ~s1, ~s2, ~s3,
   "MEH111", NA_real_, NA, NA, NA, "both", "internal", "internal",
   "NUP200", 0.88, 18, 3, TRUE, NA_character_, "both", NA_character_,
   "LOL101", 0.71, 15, 0, FALSE, "distance", "distance", "distance"
)
d |> add_subject_context()


benwhicks/retention.helpers documentation built on Feb. 6, 2023, 5:02 p.m.