apply_route_map | R Documentation |
Used to convert nonstandard dose route values (i.e. "IV") to standard values ("intravascular").
apply_route_map(route_map = list(), route_col = NULL, DS = NULL)
route_map |
List with names corresponding to the route replacement and a vector of regular expressions to match. |
route_col |
Column name with the route data. |
DS |
Dataframe containing the dataset. |
Dataset with the route mapping applied.
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"]])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.