dispersion {polmineR} | R Documentation |
Dispersion of a query or multiple queries.
Description
The method returns a data.table
with the number of matches of a query
or multiple queries (optionally frequencies) in a corpus or subcorpus as
partitioned by one or two s-attributes.
Usage
dispersion(.Object, ...)
## S4 method for signature 'slice'
dispersion(
.Object,
query,
s_attribute,
cqp = FALSE,
p_attribute = getOption("polmineR.p_attribute"),
freq = FALSE,
fill = TRUE,
mc = FALSE,
progress = FALSE,
verbose = FALSE,
...
)
## S4 method for signature 'partition'
dispersion(
.Object,
query,
s_attribute,
cqp = FALSE,
p_attribute = getOption("polmineR.p_attribute"),
freq = FALSE,
fill = TRUE,
mc = FALSE,
progress = TRUE,
verbose = FALSE,
...
)
## S4 method for signature 'subcorpus'
dispersion(
.Object,
query,
s_attribute,
cqp = FALSE,
p_attribute = getOption("polmineR.p_attribute"),
freq = FALSE,
fill = FALSE,
mc = FALSE,
progress = TRUE,
verbose = FALSE,
...
)
## S4 method for signature 'corpus'
dispersion(
.Object,
query,
s_attribute,
cqp = is.cqp,
p_attribute = getOption("polmineR.p_attribute"),
freq = FALSE,
fill = TRUE,
mc = FALSE,
progress = FALSE,
verbose = FALSE,
...
)
## S4 method for signature 'character'
dispersion(
.Object,
query,
s_attribute,
cqp = is.cqp,
p_attribute = getOption("polmineR.p_attribute"),
freq = FALSE,
fill = TRUE,
mc = FALSE,
progress = TRUE,
verbose = TRUE,
...
)
## S4 method for signature 'hits'
dispersion(
.Object,
source,
s_attribute,
freq = FALSE,
fill = TRUE,
verbose = TRUE,
...
)
## S4 method for signature 'remote_corpus'
dispersion(.Object, ...)
## S4 method for signature 'remote_subcorpus'
dispersion(.Object, ...)
Arguments
.Object |
A |
... |
Further parameters. |
query |
A |
s_attribute |
A |
cqp |
If |
p_attribute |
Length one |
freq |
A |
fill |
A |
mc |
A |
progress |
A |
verbose |
A |
source |
The source of the evaluation the hits reported in
|
Details
Augmenting the data.table
with zeros for subcorpora that do
not yield query matches (argument fill
= TRUE
) may require
adding many new columns. A respective warning issued by the
data.table
package is supplemented an additional explanatory note
of the polmineR package.
Value
A data.table
.
A data.table
.
Author(s)
Andreas Blaette
See Also
The worker behind the dispersion
-method is the hits
-method.
count
Examples
use("polmineR")
dispersion("GERMAPARLMINI", query = "Integration", s_attribute = "date")
test <- partition("GERMAPARLMINI", date = ".*", p_attribute = NULL, regex = TRUE)
integration <- dispersion(
test, query = "Integration",
p_attribute = "word", s_attribute = "date"
)
integration <- dispersion(test, "Integration", s_attribute = c("date", "party"))
integration <- dispersion(test, '"Integration.*"', s_attribute = "date", cqp = TRUE)