.has_instrument | R Documentation |
Given a character vector of instrument prefixes (typically non-repeating instruments like demo and med), return whether a variable from those instruments is included. This is equivalent to something like grepl(colnames(inst), "^demo_") but will return as soon as it finds one. So, best case O(3) worst case O(n)
.has_instrument(inst, check_prefixes, USE.NAMES = FALSE)
inst |
Dataframe of a single instrument, this will typically be the output of filtering the report where redcap_repeating_instrument is NA |
check_prefixes |
Which prefixes to check, typically c('demo','med') |
USE.NAMES |
Whether to return prefixes as names in the logical vector, defaults to FALSE |
Logical vector, TRUE if prefix is found in the colnames of the instrument df, FALSE if not
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.