countCompetitors | R Documentation |
This may either be counted within a window of tokens from the current one, or all referents competing with the current one may be counted, or a mix of both conditions. By default, we count referents intervening between the current and previous mention. Despite its name, tokenOrder can be set as unitSeqLast or similar.
countCompetitors(
cond = NULL,
windowSize = Inf,
tokenSeq = NULL,
unitSeq = NULL,
chain = NULL,
between = T,
exclFrag = F,
combinedChunk = NULL,
nonFragmentMember = F,
windowType = "unit"
)
countCompetitorsMatch(
matchCol,
windowSize = Inf,
tokenOrder = NULL,
chain = NULL,
between = T,
exclFrag = F,
combinedChunk = NULL,
nonFragmentMember = F
)
countMatchingCompetitors(
matchCol,
windowSize = Inf,
tokenOrder = NULL,
chain = NULL,
between = T,
exclFrag = F,
combinedChunk = NULL,
nonFragmentMember = F
)
cond |
The condition under which something counts as a competitor. Leave blank if anything goes. |
windowSize |
The size of the window in which you will be counting. |
unitSeq |
The vector of tokenOrder values where the mentions appeared. You can choose tokenOrderFirst, tokenOrderFirst, or maybe an average of the two. By default it's tokenOrderFirst. |
chain |
The chain that each mention belongs to. |
between |
Do we only count competitors between the current mention and previous mention? (If |
exclFrag |
Exclude 'fragments' (i.e. members of a combined chunk which do not serve as meaningful chunks in their own right) |
combinedChunk |
The |
nonFragmentMember |
Vector indicating whether each entry is a non-fragment member, i.e. a member of a combined chunk that also serves as a meaningful chunk in its own right. |
matchCol |
The column for which a value is to be matched. |
tokenOrder |
The vector of sequence values values where the mentions appeared. Common choices are docTokenSeqFirst, docTokenSeqLast, wordTokenSeqFirst and wordTokenseqLast (the last two are available after running addIsWordField on a rezrObj. By default it's docTokenSeqLast. |
A vector of number of competitors.
sbc007$trackDF$default %>%
rez_mutate(isZero = (text == "<0>")) %>%
rez_mutate(noCompetitors = countCompetitors(windowSize = 40, between = F),
noMatchingCompetitors = countMatchingCompetitors(isZero, windowSize = 40, between = F))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.