Learn R Programming

polmineR (version 0.7.9)

textstat-class: S4 textstat class

Description

Superclass for features, context, and partition class.

Usage

# S4 method for textstat
name(x)

# S4 method for textstat,character name(x) <- value

# S4 method for textstat head(x, ...)

# S4 method for textstat tail(x, ...)

# S4 method for textstat dim(x)

# S4 method for textstat nrow(x)

# S4 method for textstat round(x, digits = 2)

# S4 method for textstat colnames(x)

# S4 method for textstat sort(x, by, decreasing = TRUE)

as.bundle(object, ...)

# S4 method for textstat,textstat +(e1, e2)

# S4 method for textstat subset(x, ...)

# S4 method for textstat as.data.table(x)

# S4 method for textstat as.data.frame(x)

# S4 method for textstat p_attributes(.Object)

# S4 method for textstat [[(x, i)

# S4 method for textstat,ANY,ANY,ANY [(x, i, j)

# S4 method for textstat view(.Object)

Arguments

x

textstat object

value

A character vector to assign as name to slot name of a textstat class object.

...

further parameters

digits

no of digits

by

by

decreasing

logical

object

a textstat object

e1

object 1

e2

object 2

.Object

an object

i

vector to index data.table in stat-slot

j

vector to index data.table in stat-slot

Slots

p_attribute

Object of class "character" p-attribute of the query

corpus

Object of class "character"

stat

Object of class "data.table" statistics of the analysis

name

name of the object

encoding

Object of class "character" encoding of the corpus

Details

Objects derived from the textstat class can be indexed with simple square brackets ("[") to get rows specified by an numeric/integer vector, and with double square brackets ("[[") to get specific columns from the data.table in the slot stat.

textstat objects can have a name, which can be retrieved, and set using the name-method and name<-, respectively.

Examples

Run this code
# NOT RUN {
use("polmineR")
P <- partition("GERMAPARLMINI", date = ".*", p_attribute = "word", regex = TRUE)
y <- cooccurrences(P, query = "Arbeit")
y[1:25]
y[,c("word", "ll")]
y[1:25, "word"]
y[1:25][["word"]]
y[which(y[["word"]] %in% c("Arbeit", "Sozial"))]
y[ y[["word"]] %in% c("Arbeit", "Sozial") ]
# }

Run the code above in your browser using DataLab