hla_mm_level_str: HLA mismatch level from string

Description Usage Arguments Details Value Examples

View source: R/hla_mismatch.R

Description

Vectorised function to calculate HLA mismatch levels where the HLA A, B and DR mismatch is recorded as a string rather than as separate numeric values, e.g. "1:0:1" or "101". The function calculates the mismatch level as used in the UK national deceased donor kidney matching scheme. By default, the function assumes a single separator character is used between each of the three numbers in the mismatch; if not, set the sep parameter to FALSE. This function needs the stringr package to be installed.

Usage

1

Arguments

mm

character string vector of HLA mismatches, e.g. "1:1:0" or "211"

sep

logical to indicate whether separator used in the HLA mismatch strings (default TRUE)

Details

The HLA mismatch level is derived from UK kidney matching policies which can be found on the NHS Blood & Transplant ODT website at www.odt.nhs.uk

Value

numeric vector of HLA mismatch levels

Examples

1
2
3
4
5
# using string of HLA mismatches with colons
hla_mm_level_str("1:1:0")

# using string of HLA mismatches without separator
hla_mm_level_str("211", sep = FALSE)

transplantr documentation built on Feb. 28, 2020, 5:07 p.m.