configuration: Character Configuration

Description Usage Arguments Value Active and Passive Configurations See Also Examples

View source: R/configuration.R

Description

The function configuration(...) Creates drama configuration matrix as a QDConfiguration object, which is also a data.frame. The S3 function as.matrix() can be used to extract a numeric or logical matrix containing the core.

Usage

1
2
3
4
5
6
7
8
9
configuration(
  d,
  segment = c("Act", "Scene"),
  mode = c("Active", "Passive"),
  onlyPresence = FALSE
)

## S3 method for class 'QDConfiguration'
as.matrix(x, ...)

Arguments

d

A QDDrama object

segment

A character vector, either "Act" or "Scene". Partial matching allowed.

mode

Character vector, should be either "Active" or "Passive". Passive configurations express when characters are mentioned, active ones when they speak themselves. Please note that extracting passive configuration only makes sense if some form of coreference resolution has taken place on the text, either manually or automatic. If not, only very basic references (first person pronouns and proper names) are represented, which usually gives a very wrong impression.

onlyPresence

If TRUE, the function only records whether a character was present. If FALSE (which is the default), the function counts the number of tokens spoken (active) or referenced (passive).

x

An object of class QDConfiguration

...

All other arguments are passed to as.matrix.data.frame.

Value

Drama configuration matrix as a QDConfiguration object (of type data.frame).

Active and Passive Configurations

By default, we generate active matrices that are based on the character speech. A character is present in a scene or act, if they make an utterance. Using the argument mode, we can also create passive configuration matrices. They look very similar, but are based on who's mentioned in a scene or an act.

See Also

characterNames

Examples

1
2
3
4
5
6
# Active configuration matrix
data(rksp.0)
cfg <- configuration(rksp.0)

# Passive configuration matrix
cfg <- configuration(rksp.0, mode="Passive")

DramaAnalysis documentation built on Jan. 13, 2021, 10:02 p.m.