| partition_class {polmineR} | R Documentation |
Partition class and methods.
Description
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.
Usage
## S4 method for signature 'partition'
p_attributes(.Object, p_attribute = NULL, decode = TRUE)
## S4 method for signature 'subcorpus'
p_attributes(.Object, p_attribute = NULL, decode = TRUE)
is.partition(x)
## S4 method for signature 'partition'
enrich(
.Object,
p_attribute = NULL,
decode = TRUE,
verbose = TRUE,
mc = FALSE,
...
)
## S4 method for signature 'partition'
as.regions(x)
## S4 method for signature 'partition'
split(x, gap, ...)
Arguments
.Object |
A |
p_attribute |
a p-attribute (for enriching) / performing count. |
decode |
|
x |
A |
verbose |
|
mc |
|
... |
further parameters passed into |
gap |
An integer value specifying the minimum gap between regions for performing the split. |
Details
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 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 split()-method will split a partition object into a
partition_bundle if gap between strucs exceeds a minimum number of tokens
specified by gap. Relevant to split up a plenary protocol into speeches.
Note: To speed things up, the returned partitions will not include
frequency lists. The lists can be prepared by applying enrich on the
partition_bundle object that is returned.
Slots
nameA name to identify the object (
charactervector with length 1); useful when multiplepartitionobjects are combined to apartition_bundle.corpusThe CWB indexed corpus the partition is derived from (
charactervector with length 1).encodingEncoding of the corpus (
charactervector with length 1).s_attributesA named
listwith the s-attributes specifying the partition.explanationObject of class
character, an explanation of the partition.cposA
matrixwith left and right corpus positions defining regions (two columns).annotationsObject of class
list.sizeTotal size of the partition (
integervector, length 1).statAn (optional)
data.tablewith counts. If present, speeds up computation of cooccurrences, as count is already present.metadataObject of class
data.frame, metadata information.strucsObject of class
integer, the strucs defining the partition.p_attributeObject of class
characterindicating the p_attribute of the count in slotstat.xmlObject of class
character, whether the xml is flat or nested.s_attribute_strucsObject of class
characterthe base nodekeyExperimental, an s-attribute that is used as a key.
callObject of class
characterthe call that generated the partition
Author(s)
Andreas Blaette
See Also
The partition-class inherits from the
textstat-class, see respective documentation to learn more.
Examples
p <- partition(
"GERMAPARLMINI",
date = "2009-11-11",
speaker = "Norbert Lammert"
)
name(p) <- "Norbert Lammert"
pb <- split(p, gap = 500L)
summary(pb)