Learn R Programming

qdap (version 2.4.6)

subject_pronoun_type: Count Subject Pronouns Per Grouping Variable

Description

Count the number of subject pronouns per grouping variables.

Usage

subject_pronoun_type(
  text.var,
  grouping.var = NULL,
  subject.pronoun.list = NULL,
  ...
)

Value

Returns a list, of class "subject_pronoun_type", of data frames regarding subject pronoun word counts:

preprocessed

List of uncollapsed dataframes (raw, prop, rnp) of the class "termco" that contain all searchable subject pronouns.

raw

raw word counts by grouping variable

prop

proportional word counts by grouping variable; proportional to each individual's subject pronoun use

rnp

a character combination data frame of raw and proportional subject pronoun use

Arguments

text.var

The text variable

grouping.var

The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.

subject.pronoun.list

A named list of subject pronouns. See Details for more.

...

Other arguments passed to termco

Details

The following subject pronoun categories are the default searched terms:

  • I - c(" i'd ", " i'll ", " i'm ", " i've ", " i ")

  • we - c(" we'd ", " we'll ", " we're ", " we've ", " we ")

  • you - c(" you'd ", " you'll ", " you're ", " you've ", " you ", " your ")

  • he - c(" he'd ", " he'll ", " he's ", " he ")

  • she - c(" she'd ", " she'll ", " she's ", " she ")

  • it - c(" it'd ", " it'll ", " it's ", " it ")

  • they - c(" they'd ", " they'll ", " they're ", "they've ", " they ")

See Also

object_pronoun_type, pronoun_type

Examples

Run this code
if (FALSE) {
dat <- pres_debates2012
dat <- dat[dat$person %in% qcv(ROMNEY, OBAMA), ]
(out <- subject_pronoun_type(dat$dialogue, dat$person))
plot(out)
plot(out, 2)
plot(out, 3)
plot(out, 3, ncol=2)

scores(out)
counts(out)
proportions(out)
preprocessed(out)

plot(scores(out))
plot(counts(out))
plot(proportions(out))
}

Run the code above in your browser using DataLab