This function should be called for a single text. It returns a data.frame with one row for each character in the play. The data.frame contains information about the number of scenes in which a character is actively speaking or passively mentions. Please note that the information about passive presence is derived from coreference resolved texts, which is a difficult task and not entirely reliable. The plays included in the package feature manually annotated coreferences (and thus, the presence is calculated on the basis of very well data).

presence(drama, passiveOnlyWhenNotActive = TRUE)

Arguments

drama

A single drama

passiveOnlyWhenNotActive

Logical. If true (default), passive presence is only counted if a character is not actively present in the scene.

Value

QDHasCharacter, data.frame. Columns actives, passives and scenes show the absolute number of scenes in which a character is actively/passively present, or the total number of scenes in the play. The column presence is calculated as \(\frac{actives-passives}{scenes}\).

Examples

data(rksp.0) presence(rksp.0)
#> corpus drama character scenes actives passives presence #> 1 test rksp.0 angelo 43 2 2 0.00000000 #> 2 test rksp.0 appiani 43 5 25 -0.46511628 #> 3 test rksp.0 battista 43 4 11 -0.16279070 #> 4 test rksp.0 camillo_rota 43 1 2 -0.02325581 #> 5 test rksp.0 claudia_galotti 43 13 12 0.02325581 #> 6 test rksp.0 conti 43 1 4 -0.06976744 #> 7 test rksp.0 der_kammerdiener 43 1 2 -0.02325581 #> 8 test rksp.0 der_prinz 43 14 26 -0.27906977 #> 9 test rksp.0 emilia 43 7 34 -0.62790698 #> 10 test rksp.0 marinelli 43 19 23 -0.09302326 #> 11 test rksp.0 odoardo 43 12 20 -0.18604651 #> 12 test rksp.0 orsina 43 6 16 -0.23255814 #> 13 test rksp.0 pirro 43 4 5 -0.02325581