R/extractwords.R

Defines functions extractwords

Documented in extractwords

extractwords <- function(words,
                         patternfile,
                         pattern.type=c('glob', 're')){
    pats <- read.table(patternfile, strip.white=TRUE)
    if (pattern.type[1] == 'glob')
        pats <- apply(pats, 1, glob2rx)
    use <- c()
    for (i in 1:length(pats))
        use <- union(use, grep(pats[i], words))
    return(use)
}

Try the austin package in your browser

Any scripts or data that you put into this service are public.

austin documentation built on May 31, 2017, 3:59 a.m.