Learn R Programming

polmineR (version 0.7.9)

context-class: Context class.

Description

Class to organize information of context analysis.

Usage

# S4 method for context
p_attributes(.Object)

# S4 method for context count(.Object)

# S4 method for context sample(x, size)

# S4 method for context enrich(.Object, s_attribute = NULL, p_attribute = NULL, decode = FALSE, verbose = TRUE, ...)

# S4 method for context trim(object, s_attribute = NULL, positivelist = NULL, p_attribute = p_attributes(object), regex = FALSE, stoplist = NULL, verbose = TRUE, progress = TRUE, ...)

Arguments

.Object

object

x

a context object

size

integer indicating sample size

s_attribute

s-attribute(s) to add to data.table in cpos-slot

p_attribute

p-attribute(s) to add to data.table in cpos-slot

decode

logical, whether to convert integer ids to expressive strings

verbose

logical, whether to be talkative

...

to maintain backwards compatibility if argument pAttribute is still used

object

a context object

positivelist

tokens that are required to be present to keep a match

regex

logical, whether positivlist / stoplist is interpreted as regular expressions

stoplist

tokens that are used to exclude a match

progress

logical, whether to show progress bar

Slots

query

Object of class "character", the query/node examined

count

Object of class "numeric" number of hits

partition

Object of class "partition", the partition the context object is based on

size_partition

Object of class "integer" the size of the partition

left

Object of class "numeric" number of tokens to the left

right

Object of class "numeric" number of tokens to the right

size

Object of class "numeric" number of tokens in the right and left context

s_attribute

Object of class "character" s-attribute

p_attribute

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

corpus

Object of class "character" the CWB corpus used

stat

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

encoding

Object of class "character" encoding of the corpus

cpos

Object of class "list" corpus positions of the hits

method

Object of class "character" statistical test used

call

Object of class "character" call that generated the object

Details

Objects of the class context include a data.table in the slot cpos. The data.table will at least include the columns "hit_no", "cpos" and "position".

The enrich-method can be used to add additional information to the data.table in the "cpos"-slot of a context-object.