R/helper-string-switch.R

Defines functions not_string_switch string_switch

string_switch <- function(field_name, codes) {
    if (is.null(codes)) return(NULL)
    .call <- list(
        quote(`%in%`),
        as.name(field_name),
        codes
    )
    as.call(.call)
}

not_string_switch <- function(field_name, codes) {
    if (is.null(codes)) return(NULL)
    .call <- list(
        quote(`%not in%`),
        as.name(field_name),
        codes
    )
    as.call(.call)
}
tarakc02/discoveryengine documentation built on Sept. 26, 2023, 12:17 a.m.