search_term: Search For Terms

Description Usage Arguments Value Examples

View source: R/search_term.R

Description

search_term - Find text items that contain a term(s).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
search_term(
  text.var,
  term,
  exclude = NULL,
  and = NULL,
  ignore.case = TRUE,
  ...
)

search_term_which(
  text.var,
  term,
  exclude = NULL,
  and = NULL,
  ignore.case = TRUE
)

Arguments

text.var

A vector of character strings.

term

A regular expression to search for (uses grep).

exclude

A regular expression to exclude cases for (uses grep).

and

A regular expression that must also be contained in addition to term (uses grep).

ignore.case

logical. Should grep be done independent of case? Can also be length 3 corresponding to the arguments term, exclude, & and.

...

ignored.

Value

search_term - Returns a text vector meeting term regex but not exclude regex.

Examples

1
2
3
search_term_which(sam_i_am, "\\bsam")
search_term(sam_i_am, "\\bsam")
search_term(sam_i_am, c('green', "\\bsam"))

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