match_words: Matches a regular expression pattern on multiple strings

Description Usage Arguments Value

View source: R/codebook.r

Description

This is intended as a 'drop-in' replacement for grepl and should give identical results This function first matches on the unique strings and then matches back to the original, so it will give a speedup iff length(unique(words)) << length(words)

Usage

1
match_words(pattern, words, ignore.case = T)

Arguments

pattern

a regular expression pattern to use

words

a vector of words, this should probably be a factor to achieve speedup

ignore.case

passed to grepl, defaults to TRUE for this function

Value

a vector of booleans indicating which words matched the pattern


amcat/amcat-r documentation built on Dec. 26, 2021, 3:12 a.m.