convertCodes: Convert codes.

View source: R/DataPrep.R

convertCodesR Documentation

Convert codes.

Description

Apply conversion table, perform approriate checks and return result.

Usage

convertCodes(code, conversionTable, strict = T)

Arguments

code

character() with original codes

conversionTable

list() mapping code to converted code.

strict

logical() If true, execution halts at incomplete conversion tables. If false unmapped codes are set to NA.

Details

By default. This will stop with error if any codes can not be converted, or if any entries are NA. Require all codes (original and converted) to be character().

Value

character() with converted codes

Examples

 gearConversion <- list()
 gearConversion["TBS"] <- "OTB"
 gearConversion["TBN"] <- "OTB"
 gearConversion["OTB"] <- "OTB"
 convertCodes(c("TBS", "TBN", "OTB"), gearConversion)

StoXProject/RstoxFDA documentation built on Nov. 12, 2024, 3:42 a.m.