coverage: Coverage for Various Objects

Description Usage Arguments Value Examples

View source: R/coverage.R

Description

coverage - Get coverage of a logical vector, term_count, or search_term object.

coverage.term_count - Extract coverage information from a term_count object including the percentage of rows that sum to zero as well as the location of non-covered rows for easy extraction.

Usage

1

Arguments

x

A logical vector, termc_count, or search_term object.

...

Ignored.

Value

term_count - Returns a proportion of elements covered by the search.

coverage.term_count - Returns a list:

not

A logical vector of all rows not covered (row sums equal zero)

covered

A logical vector of all rows covered (row sums greater than zero)

coverage

The percentage rate of

covered/(not + covered)

n_covered

The row sums of the unique terms

total_terms

The row sums of the terms

hierarchical_covered*

A hierarchical list (matching the term.list structure) of logical vectors of all rows covered (row sums greater than zero)

hierarchical_n_covered*

A hierarchical vector (matching the term.list structure) of the row sums of the unique terms

hierarchical_coverage*

A hierarchical vector (matching the term.list structure) of the percentage rate of

covered/(not + covered)

*Only applies to term_count output that was generated with a hierarchical term.list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
coverage(sample(c(TRUE, FALSE), 1000, TRUE))

data(presidential_debates_2012)

discoure_markers <- list(
    like = c("love", "like"),
    water = c("lake", "ocean", "water"),
    justify = c("because"),
    he = c("\\bhe", "him"),
    we = c("\\bwe", "\\bus", "\\bour")
)

library(dplyr)
(markers2 <- with(presidential_debates_2012,
    term_count(dialogue, TRUE, discoure_markers)
))

coverage(markers2)

presidential_debates_2012[coverage(markers2)$not, "dialogue"] %>%
   c()

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