frequencyQuery,KorAPConnection-method {RKorAPClient}R Documentation

Query frequencies of search expressions in virtual corpora

Description

frequencyQuery combines corpusQuery(), corpusStats() and ci() to compute a tibble with the absolute and relative frequencies and confidence intervals of one ore multiple search terms across one or multiple virtual corpora.

Usage

## S4 method for signature 'KorAPConnection'
frequencyQuery(
  kco,
  query,
  vc = "",
  conf.level = 0.95,
  as.alternatives = FALSE,
  ...
)

Arguments

kco

KorAPConnection() object (obtained e.g. from KorAPConnection()

query

corpus query string(s.) (can be a vector). The query language depends on the ql parameter. Either query must be provided or KorAPUrl.

vc

virtual corpus definition(s) (can be a vector)

conf.level

confidence level of the returned confidence interval (passed through ci() to prop.test()).

as.alternatives

LOGICAL that specifies if the query terms should be treated as alternatives. If as.alternatives is TRUE, the sum over all query hits, instead of the respective vc token sizes is used as total for the calculation of relative frequencies.

...

further arguments passed to or from other methods (see corpusQuery()), most notably expand, a logical that decides if query and vc parameters are expanded to all of their combinations. It defaults to TRUE, if query and vc have different lengths, and to FALSE otherwise.

Value

A tibble, with each row containing the following result columns for query and vc combinations:

Examples

## Not run: 

KorAPConnection(verbose = TRUE) |>
  frequencyQuery(c("Mücke", "Schnake"), paste0("pubDate in ", 2000:2003))

## End(Not run)


[Package RKorAPClient version 1.1.0 Index]