Find a keyword in all names and labels of a list of datasets.
find_keyword(keyword, data = getOption("edc_lookup"), ignore_case = TRUE)
a tibble
the keyword to search for. Can handle regular expressions (see examples).
the lookup dataframe where to search the keyword. Can be set using edc_options(edc_lookup=my_data)
, which is done automatically when calling read_trialmaster()
.
should case differences be ignored in the match? Default to TRUE
.
if (FALSE) {
path = system.file("extdata/Example_Export_SAS_XPORT_2022_08_25_15_16.zip",
package="EDCimport", mustWork=TRUE)
w = read_trialmaster(path, verbose=FALSE)
find_keyword("patient")
#with regex
find_keyword("patient$")
find_keyword("\\d")
find_keyword("(Trial|Form) Name")
find_keyword("\\(") #you need to escape special characters
}
Run the code above in your browser using DataLab