The partition class is used to manage subcorpora. It is an S4 class, and
a set of methods is defined for the class. The class inherits
from the classes count and textstat.
# S4 method for partition
p_attributes(.Object, p_attribute = NULL, ...)is.partition(x)
# S4 method for partition
enrich(.Object, p_attribute = NULL, decode = TRUE,
verbose = TRUE, mc = FALSE, ...)
a partition object
a p-attribute (for enriching) / performing count.
further parameters passed into count when calling enrich, and ...
a partition object
logical value, whether to decode token ids into strings when performing count
logical value, whether to output messages
logical or, if numeric, providing the number of cores
nameA name to identify the object (character vector with length 1); useful when multiple
partition objects are combined to a partition_bundle.
corpusThe CWB indexed corpus the partition is derived from (character vector with length 1).
encodingEncoding of the corpus (character vector with length 1).
s_attributesA named list with the s-attributes specifying the partition.
explanationObject of class character, an explanation of the partition.
cposA matrix with left and right corpus positions defining regions (two columns).
annotationsObject of class list.
sizeTotal size of the partition (integer vector, length 1).
statAn (optional) data.table with counts. If present, speeds up computation of cooccurrences,
as count is already present.
metadataObject of class data.frame, metadata information.
strucsObject of class intger, the strucs defining the partition.
p_attributeObject of class character indicating the p_attribute of the
count in slot stat.
xmlObject of class character, whether the xml is flat or nested.
s_attribute_strucsObject of class character the base node
callObject of class character the call that generated the partition
As partition objects inherit from count and textstat class, methods
available are view to inspect the table in the stat slot, name and
name<- to retrieve/set the name of an object, and more.
The p_attributes-method returns the p-attributes defined for the
corpus the partition is derived from, if argument p_attribute is NULL
(the default). If p_attribute is defined, the unique values for the p-attribute
are returned.
The is.partition function returns a logical value whether x
is a partition, or not.
The enrich-method will add a count of tokens defined by argument
p_attribute to slot stat of the partition object.
The partition-class inherits from the textstat-class, see
respective documentation to learn more.