Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

partition_bundle-class

Bundle of partitions (partition_bundle class).


Description

Class and methods to manage bundles of partitions.

Usage

## S4 method for signature 'partition_bundle'
show(object)

## S4 method for signature 'partition_bundle'
summary(object, progress = FALSE)

## S4 method for signature 'partition_bundle'
merge(x, name = "", verbose = FALSE)

## S4 method for signature 'partition_bundle,ANY,ANY,ANY'
x[i]

## S4 method for signature 'partition_bundle'
barplot(height, ...)

## S4 method for signature 'list'
as.partition_bundle(.Object, ...)

## S4 method for signature 'environment'
partition_bundle(.Object)

## S4 method for signature 'partition_bundle'
enrich(.Object, mc = FALSE, progress = TRUE, verbose = FALSE, ...)

## S4 method for signature 'partition_bundle'
s_attributes(.Object, s_attribute, ...)

flatten(object)

Arguments

object

a partition_bundle object

progress

logical

x

a partition_bundle object

name

the name for the new partition

verbose

logical

i

integer index

height

height

...

further parameters

.Object

a partition_bundle object

mc

logical or, if numeric, providing the number of cores

s_attribute

the s-attribute to use

Details

The merge-method aggregates several partitions into one partition. The prerequisite for this function to work properly is that there are no overlaps of the different partitions that are to be summarized. Encodings and the root node need to be identical, too.

Using brackets can be used to retrieve the count for a token from the partition objects in a partition_bundle.

Value

An object of the class 'partition. See partition for the details on the class.

a partition_bundle object

Slots

objects

Object of class list the partitions making up the bundle

corpus

Object of class character the CWB corpus the partition is based on

s_attributes_fixed

Object of class list fixed s-attributes

encoding

Object of class character encoding of the corpus

explanation

Object of class character an explanation of the partition

xml

Object of class character whether the xml is flat or nested

call

Object of class character the call that generated the partition_bundle

Author(s)

Andreas Blaette

Examples

# merge partition_bundle into one partition
gparl <- corpus("GERMAPARLMINI") %>%
  split(s_attribute = "date") %>% 
  merge()
pb <- partition_bundle("REUTERS", s_attribute = "id")
barplot(pb, las = 2)

sc <- corpus("GERMAPARLMINI") %>%
  subset(date == "2009-11-10") %>%
  split(s_attribute = "speaker") %>%
  barplot(las = 2)

polmineR

Verbs and Nouns for Corpus Analysis

v0.8.5
GPL-3
Authors
Andreas Blaette [aut, cre] (<https://orcid.org/0000-0001-8970-8010>), Christoph Leonhardt [ctb]
Initial release
2020-09-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.