Bundle Class
A bundle
is used to combine several objects (partition
, context
,
features
, cooccurrences
objects) into one S4 class object. Typically,
a class inheriting from the bundle
superclass will be used. When working with a
context_bundle
, a features_bundle
, a cooccurrences_bundle
, or a
context_bundle
, a similar set of standard methods is available to perform
transformations.
## S4 replacement method for signature 'bundle' name(x) <- value ## S4 method for signature 'bundle' length(x) ## S4 method for signature 'bundle' names(x) ## S4 replacement method for signature 'bundle,vector' names(x) <- value ## S4 method for signature 'bundle' unique(x) ## S4 method for signature 'bundle,bundle' e1 + e2 ## S4 method for signature 'bundle,textstat' e1 + e2 ## S4 method for signature 'bundle' x[[i]] ## S4 replacement method for signature 'bundle' x[[i]] <- value ## S4 method for signature 'bundle' x$name ## S4 replacement method for signature 'bundle' x$name <- value ## S4 method for signature 'bundle' sample(x, size) ## S4 method for signature 'list' as.bundle(object, ...) ## S4 method for signature 'textstat' as.bundle(object) ## S3 method for class 'bundle' as.data.table(x, keep.rownames, col, ...) ## S4 method for signature 'bundle' as.matrix(x, col) ## S4 method for signature 'bundle' subset(x, ...) ## S4 method for signature 'bundle' as.list(x) ## S3 method for class 'bundle' as.list(x, ...) ## S4 method for signature 'bundle' get_corpus(x)
x |
a bundle object |
value |
character string with a name to be assigned |
e1 |
object 1 |
e2 |
object 2 |
i |
An |
name |
The name of an object in the |
size |
number of items to choose to generate a sample |
object |
A |
... |
Further parameters |
keep.rownames |
Required argument to safeguard consistency with S3
method definition in the |
col |
columns of the |
corpus
The CWB corpus the objects in the bundle
are based on, a length 1
character
vector.
objects
An object of class list
.
p_attribute
Object of class character
.
encoding
The encoding of the corpus.
Andreas Blaette
parties <- s_attributes("GERMAPARLMINI", "party") parties <- parties[-which(parties == "NA")] party_bundle <- partition_bundle("GERMAPARLMINI", s_attribute = "party") length(party_bundle) names(party_bundle) get_corpus(party_bundle) party_bundle <- enrich(party_bundle, p_attribute = "word") summary(party_bundle) parties_big <- party_bundle[[c("CDU_CSU", "SPD")]] summary(parties_big) p <- partition("GERMAPARLMINI", date = "2009-11-11") pb <- partition_bundle(p, s_attribute = "party") names(pb) pb[["NA"]] <- NULL names(pb) pb <- partition_bundle("GERMAPARLMINI", s_attribute = "party") pb$SPD # access partition names "SPD" in partition_bundle pb pb <- partition_bundle("GERMAPARLMINI", s_attribute = "party") pb$"NA" <- NULL # quotation needed if name is "NA" use("polmineR") pb <- partition_bundle("REUTERS", s_attribute = "id") coocs <- cooccurrences(pb, query = "oil", cqp = FALSE) dt <- as.data.table(coocs, col = "ll") m <- as.matrix(dt[, 2:ncol(dt)], rownames = dt[["token"]])
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.