syllable (version 0.1.2)

readability_word_stats_by: Readability Word Statistics By Grouping Variable(s)

Description

Word statistics commonly used to calculate readability sores by grouping variable(s).

Usage

readability_word_stats_by(x, group, group.names, 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.
group.names
A vector of names that corresponds to group. Generally for internal use.
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) readability word statistics.

Examples

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

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

Run the code above in your browser using DataLab