Learn R Programming

polmineR (version 0.7.9)

subcorpus: Virtual class subcorpus

Description

The classes regions and partition can be used to define subcorpora. Unlike the regions class, the partition class may include statistical evaluations. The virtual class subcorpora is a mechanism to define methods for these classes without making regions the superclass of partition.

Usage

# S4 method for subcorpus
aggregate(x)

Arguments

x

An object of a class belonging to the virtual class subcorpus, i.e. a partition or regions object.

Details

The method aggregate will deflate the matrix in the slot cpos, i.e. it checks for each new row in the matrix whether it increments the end of the previous region (by 1), and ensure that the cpos matrix defines disjoined regions.

Examples

Run this code
# NOT RUN {
P <- new(
  "partition",
  cpos = matrix(data = c(1:10, 20:29), ncol = 2, byrow = TRUE),
  stat = data.table::data.table()
)
P2 <- aggregate(P)
P2@cpos
# }

Run the code above in your browser using DataLab