syllable (version 0.1.2)

tally_both_vector_by: Vector Tally of Short-Syllabic and Poly-Syllabic Words By Grouping Variable(s)

Description

Short-syllabic (< 3 syllables) and poly-syllabic (>= 3 syllables) word tallies for the words in a vector of strings by grouping variable(s).

Usage

tally_both_vector_by(x, group, as.tibble = tibble_output(), ...)

Arguments

x
A character vector.
group
The grouping variable(s). Takes a single grouping variable or a list of 1 or more grouping variables.
as.tibble
logical. If TRUE the output class will be set to a tibble, otherwise a data.table. Default checks getOption("tibble.out") as a logical. If this is NULL the default tibble_output will set as.tibble to TRUE if dplyr is loaded. Otherwise, the output will be a data.table.
...
ignored.

Value

Returns a data.frame (data.table) of integer tallies for the total number of short syllable (short) and poly syllable (poly) words for each string in the vector by grouping variable(s).

See Also

Other syllable.functions: count_string, count_vector_by, count_vector, sum_string, sum_vector_by, sum_vector, tally_both_string, tally_both_vector, tally_di_string, tally_di_vector_by, tally_di_vector, tally_mono_string, tally_mono_vector_by, tally_mono_vector, tally_poly_string, tally_poly_vector_by, tally_poly_vector, tally_short_string, tally_short_vector_by, tally_short_vector

Examples

Run this code
dat <- data.frame(
   text = c("I like excellent chicken.", "I want eggs Benedict now.", "Really?"),
   group = c("A", "B", "A")
)
tally_both_vector_by(dat$text, dat$group)

with(presidential_debates_2012, tally_both_vector_by(dialogue, person))
with(presidential_debates_2012, tally_both_vector_by(dialogue, list(role, time)))
with(presidential_debates_2012, tally_both_vector_by(dialogue, list(person, time)))

Run the code above in your browser using DataLab