Used to convert nonstandard dose route values (i.e. "IV") to standard values ("intravascular").
Usage
apply_route_map(route_map = list(), route_col = NULL, DS = NULL)
Examples
if(system.file(package="readxl") !=""){
library(readxl)
#loading a dataset
data_file = system.file(package="formods","test_data","TEST_DATA.xlsx")
myDS = readxl::read_excel(path=data_file, sheet="DATA")
route_map = list(
intravascular = c("^(?i)iv$"),
extravascular = c("^(?i)sc$", "^(?i)oral")
)
utils::head(myDS[["ROUTE"]])
myDS = apply_route_map(route_map = route_map,
route_col = "ROUTE",
DS = myDS)
utils::head(myDS[["ROUTE"]])
}
#> [1] "intravascular" "intravascular" "intravascular" "intravascular"
#> [5] "intravascular" "intravascular"