R/has_leading_pattern.R

Defines functions has_leading_pattern

Documented in has_leading_pattern

#' Logical Function checking for leading patterns
#' @param pattern expression in a non-regex format that is automatically converted to the {pattern}$ in the function
#' @export

has_leading_pattern <-
        function(strings, pattern) {
                output <- vector()
                for(string in strings) {
                        output <- c(output, grepl(paste0("^", pattern), string))
                }
                return(output)
        }
meerapatelmd/centipede documentation built on Jan. 1, 2021, 9:27 a.m.