unnest_term_list: Unnest a Nested Term List

Description Usage Arguments Value Examples

Description

Term lists can be stored as lists within a list for use in termc_count in a hierarchical fashion. This structure is not always useful and can be taken to a single nest via unnest_term_list. The function detects if the term.list is nested or not and then unnests only if needed, thus allowing it to be safely used on both nested and unnested term.lists.

Usage

1
unnest_term_list(term.list, ...)

Arguments

term.list

A list of named character vectors. 'codeterm_count can be used in a hierarchical fashion as well; that is a list of regexes can be passed and counted and then a second (or more) pass can be taken wit a new set of regexes on only those rows/text elements that were left untagged (count rowSums is zero). This is accomplished by passing a list of lists of regexes. See Examples for the hierarchical terms section for a demonstration.

...

ignored.

Value

Returns a list of one level.

Examples

1
2
3
4
5
6
7
x <- list(
    a = setNames(as.list(LETTERS[1:5]),LETTERS[1:5]),
    b = setNames(as.list(LETTERS[6:11]), LETTERS[6:11])
)
y <- list(a=LETTERS[1:11])
unnest_term_list(x)
unnest_term_list(y)

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