ukkdri_q {transplantr}R Documentation

UK Kidney Donor Risk Index Quartile (2019)

Description

Vectorised function to convert UKKDRI values to quartiles of risk. The function takes a numeric vector of UKKDRI values as input, and returns a vector of quartiles. By default this is also a numeric vector with values 1-4, but this can be changed to a character string vector of D1-D4 to match the nomenclature in the NHSBT ODT documentation by setting the prefix parameter to TRUE. The output can also be as a vector of factors by setting fct to TRUE (this can be combined with the prefix parameter).

Usage

ukkdri_q(dri, prefix = FALSE, fct = FALSE)

Arguments

dri

numeric vector of UKKDRI values

prefix

whether to prefix results with "D" (default FALSE)

fct

whether to return results as a factor (default FALSE)

Details

The UK KDRI quartile ranges are documented in the UK kidney matching policy which can be found on the NHS Blood & Transplant ODT website at www.odt.nhs.uk

Value

vector of UKKDRI quartiles

Examples

# obtain quartile of a single value
ukkdri_q(1.01)

# factor vector of results with prefix
dri = c(0.69, 1.01, 1.36, 1.54)
ukkdri_q(dri, prefix = TRUE, fct = TRUE)

[Package transplantr version 0.2.0 Index]