colo: Make Regex to Locate Strings Containing Co-ocuring Substrings

Description Usage Arguments Value Examples

View source: R/colo.R

Description

Make a regex to locate strings that contain >= 2 substrings with optional negation.

Usage

1
colo(..., not = NULL, copy2clip = getOption("termco.copy2clip"))

Arguments

not

A substring to exclude from consideration.

copy2clip

logical. If codeTRUE uses write_clip to copy the output to the clipboard. This option is most useful when trying to build a list regular expression model for easy pasting between testing a regex and putting it into the model. This argument can be set globally by setting options(termco.copy2clip = TRUE).

...

Terms that cooccur/collocate

Value

Returns a regular expression. If Windows attempts to copy to clipboard as well.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
colo('overall', 'course')
colo('overall', 'course', "eval")
colo('overall', 'course', not="instructor")

search_term(sam_i_am, colo("^i\\b", "like"))
search_term(sam_i_am, colo("^i\\b", "like", "not"))
search_term(sam_i_am, colo("^i\\b", "like|not"))
search_term(sam_i_am, colo("^i\\b", "like", not="not"))

## End(Not run)

trinker/termco documentation built on Jan. 7, 2022, 3:32 a.m.