View source: R/dispersionQuery.R
| corpusPartition | R Documentation |
Discover metadata groups and their token counts, or define a custom partition. Discovery checks the base corpus independently of query hits, so that parts without hits are retained without downloading the corpus.
corpusPartition(
kco,
by,
values = NULL,
vc = "",
parts = NULL,
classify = NULL,
fields = NULL,
verbose = kco@verbose,
cacheAs = NULL,
regex = NULL
)
kco |
A |
by |
Metadata field. The aliases |
values |
Vector of metadata values; optional names label the parts.
If neither |
vc |
Base virtual corpus. All parts are intersected with this corpus. |
parts |
Alternatively, a uniquely named vector of virtual-corpus
definitions. For sampling arbitrary definitions, also provide |
classify |
Optional function of a matches data frame returning one part
label per row, or |
fields |
Metadata fields needed by |
verbose |
Whether to print progress. |
cacheAs |
Optional result file; see |
regex |
Optional trailing-suffix grouping rule for automatic discovery;
see dispersionAnalysis,KorAPQuery-method. Defaults to removing a year suffix
for |
A tibble of class KorAPCorpusPartition with part, value, vc,
and tokens columns. Attributes record the metadata mapping, base corpus,
server, index revision, covered tokens and excluded tokens. Overlapping
parts are rejected by comparing their summed sizes with their union.
An incomplete inventory explicitly restricts the population to its union,
with a warning; it does not silently stand for the whole base corpus.
## Not run:
kco <- KorAPConnection()
years <- corpusPartition(kco, "year", 2020:2022, vc = "referTo ratskorpus")
countries <- corpusPartition(kco, "region", c("DE", "AT", "CH"))
dispersionQuery(kco, "NutzerInnen", partitions = list(year = years))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.