Learn R Programming

qdap (version 1.3.5)

end_mark: Sentence End marks

Description

end_mark - Grab the sentence end marks for a transcript. This can be useful to categorize based on sentence type. end_mark_by - Grab the sentence end marks for a transcriptby grouping variable(s).

Usage

end_mark(text.var, missing.end.mark = "_", missing.text = NA,
  other.endmarks = NULL)

end_mark_by(text.var, grouping.var, digits = 3, percent = FALSE,
  zero.replace = 0, ...)

Arguments

text.var
The text variable.
missing.end.mark
A value to use for sentences with missing endmarks.
missing.text
A value to use for sentences with missing (NA) text.
other.endmarks
Other 1-2 character endmarks tos earch for.
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.
percent
logical. If TRUE output given as percent. If FALSE the output is proportion.
zero.replace
Value to replace 0 values with.
digits
Integer; number of decimal places to round when printing.
...
Other arguments passed to end_mark.

Value

  • Returns a character vector of qdap end marks for each sentence. End marks include:
  • "."Declarative sentence.
  • "?"Question sentence.
  • "!"Exclamatory sentence.
  • "|"Incomplete sentence.
  • "*."Imperative-declarative sentence.
  • "*?"Imperative-question sentence (unlikely to occur)
  • "*!"Imperative-exclamatory sentence.
  • "*|"Imperative-incomplete sentence.
  • "no.em"No end mark.
  • "blank"Empty cell/NA.

Examples

Run this code
end_mark(DATA.SPLIT$state)
end_mark(mraja1spl$dialogue)
ques <- mraja1spl[end_mark(mraja1spl$dialogue) == "?", ] #grab questions
htruncdf(ques)
non.ques <- mraja1spl[end_mark(mraja1spl$dialogue) != "?", ] #non questions
htruncdf(non.ques, 20)
ques.per <- mraja1spl[end_mark(mraja1spl$dialogue) %in% c(".", "?"), ] #grab ? and .
htruncdf(ques.per, 20)

(x_by <- end_mark_by(DATA.SPLIT$state, DATA.SPLIT$person))
scores(x_by)
counts(x_by)
proportions(x_by)
preprocessed(x_by)
plot(scores(x_by))
plot(counts(x_by))
plot(proportions(x_by))
plot(preprocessed(x_by))

Run the code above in your browser using DataLab