Description Usage Arguments Value See Also Examples
Count number of occurrences of a query (CQP syntax may be used) or, if query is NULL (default), of all tokens.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | count(.Object, ...)
## S4 method for signature 'partition'
count(.Object, query = NULL, cqp = is.cqp,
id2str = TRUE, pAttribute = getOption("polmineR.pAttribute"),
mc = getOption("polmineR.cores"), verbose = TRUE, progress = FALSE)
## S4 method for signature 'partitionBundle'
count(.Object, query, pAttribute = NULL,
freq = FALSE, total = T, mc = F, progress = T, verbose = FALSE)
## S4 method for signature 'character'
count(.Object, query = NULL,
pAttribute = getOption("polmineR.pAttribute"), verbose = TRUE)
## S4 method for signature 'vector'
count(.Object, corpus, pAttribute)
|
.Object |
a |
... |
further parameters |
query |
a character vector (one or multiple terms to be looked up), CQP syntax can be used. |
cqp |
either logical (TRUE if query is a CQP query), or a function to check whether query is a CQP query or not (defaults to is.query auxiliary function) |
id2str |
logical, whether to add rownames (only if query is NULL) |
pAttribute |
the p-attribute(s) to use |
mc |
logical, whether to use multicore (defaults to FALSE) |
verbose |
logical, whether to be verbose |
progress |
logical, whether to show progress |
freq |
logical, if FALSE, counts will be reported, if TRUE, frequencies |
total |
defaults to FALSE, if TRUE, the added value of counts (column: TOTAL) will be amended to the data.table that is returned |
corpus |
name of CWB corpus |
a "data.table"
For a metadata-based breakdown of counts
(i.e. a differentiation by s-attributes), see "dispersion"
.
count
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
\dontrun{
use("polmineR.sampleCorpus")
debates <- partition("PLPRBTTXT", list(text_id=".*"), regex=TRUE)
x <- count(debates, "Arbeit") # get frequencies for one token
x <- count(debates, c("Arbeit", "Freizeit", "Zukunft")) # get frequencies for multiple tokens
x <- count("PLPRBTTXT", c("Migration", "Integration"), "word")
debates <- partitionBundle(
.Object="PLPRBTTXT",
def=list(text_date=sAttributes("PLPRBTTXT", "text_date")),
regex=TRUE, mc=FALSE, verbose=FALSE
)
aiu <- count(debates, c("Arbeit", "Integration", "Umwelt"))
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.