Get hits for a (set of) queries, optionally with s-attribute values.
hits(.Object, ...)# S4 method for character
hits(.Object, query, cqp = FALSE, sAttribute = NULL,
pAttribute = "word", size = FALSE, freq = FALSE, mc = FALSE,
verbose = TRUE, progress = TRUE)
# S4 method for partition
hits(.Object, query, cqp = FALSE, sAttribute = NULL,
pAttribute = "word", size = FALSE, freq = FALSE, mc = FALSE,
progress = FALSE, verbose = TRUE)
# S4 method for partitionBundle
hits(.Object, query,
pAttribute = getOption("polmineR.pAttribute"), size = TRUE,
freq = FALSE, mc = getOption("polmineR.mc"), progress = FALSE,
verbose = TRUE)
# S4 method for hits
sample(x, size)
# S4 method for context
hits(.Object, sAttribute = NULL, verbose = TRUE)
a character, partition or partitionBundle object
further parameters
a (optionally named, see datails) character vector with one or more queries
either logical (TRUE if query is a CQP query), or a function to check whether query is a CQP query or not
s-attributes
p-attribute (will be passed into cpos)
logical - return size of subcorpus
logcial - return relative frequencies
logical, whether to use multicore
logical
logical, whether to show progress bar
a hits object
dt
a "data.table"
corpus
a "character"
vector
query
Object of class "character"
If the query character vector is named, the names of the query occurr in the data.table that is returned rather than the queries.
If freq is TRUE, the data.table returned in the DT-slot will deliberately include the subsets of the partition/corpus with no hits (query is NA, count is 0).