Learn R Programming

polmineR (version 0.7.9)

hits-class: Get Hits.

Description

Get hits for a (set of) queries, optionally with s-attribute values.

Usage

hits(.Object, ...)

# S4 method for character hits(.Object, query, cqp = FALSE, s_attribute = NULL, p_attribute = "word", size = FALSE, freq = FALSE, mc = FALSE, verbose = TRUE, progress = TRUE, ...)

# S4 method for partition hits(.Object, query, cqp = FALSE, s_attribute = NULL, p_attribute = "word", size = FALSE, freq = FALSE, mc = FALSE, progress = FALSE, verbose = TRUE, ...)

# S4 method for partition_bundle hits(.Object, query, cqp = FALSE, p_attribute = getOption("polmineR.p_attribute"), 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, s_attribute = NULL, verbose = TRUE, ...)

Arguments

.Object

a character, partition or partition_bundle object

...

further parameters

query

a (optionally named, see datails) character vector with one or more queries

cqp

either logical (TRUE if query is a CQP query), or a function to check whether query is a CQP query or not

s_attribute

s-attributes

p_attribute

p-attribute

size

logical - return size of subcorpus

freq

logcial - return relative frequencies

mc

logical, whether to use multicore

verbose

logical

progress

logical, whether to show progress bar

x

a hits object

Slots

stat

a "data.table"

corpus

a "character" vector

query

Object of class "character"

p_attribute

p-attribute that has been queried

encoding

encoding of the corpus

name

name of the object

Details

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).