Learn R Programming

readability (version 0.1.1)

readability: Calculate Readability Scores

Description

A collection of readability tools that utilize the syllable package for fast calculation of readability scores by grouping variables.

Calculate the Flesch Kincaid, Gunning Fog Index, Coleman Liau, SMOG, Automated Readability Index and an average of the 5 readability scores.

Usage

readability(x, grouping.var, order.by.readability = TRUE, group.names, ...)

Arguments

x
A character vector.
grouping.var
The grouping variable(s). Takes a single grouping variable or a list of 1 or more grouping variables.
order.by.readability
logical. If TRUE orders the results descending by readability score.
group.names
A vector of names that corresponds to group. Generally for internal use.
...
ignored

Value

Returns a data.frame (data.table) readability scores.

References

Coleman, M., & Liau, T. L. (1975). A computer readability formula designed for machine scoring. Journal of Applied Psychology, Vol. 60, pp. 283-284.

Flesch R. (1948). A new readability yardstick. Journal of Applied Psychology. Vol. 32(3), pp. 221-233. doi: 10.1037/h0057532.

Gunning, Robert (1952). The Technique of Clear Writing. McGraw-Hill. pp. 36-37.

McLaughlin, G. H. (1969). SMOG Grading: A New Readability Formula. Journal of Reading, Vol. 12(8), pp. 639-646.

Smith, E. A. & Senter, R. J. (1967) Automated readability index. Technical Report AMRLTR-66-220, University of Cincinnati, Cincinnati, Ohio.

Examples

Run this code
## Not run: 
# library(syllable)
# 
# (x1 <- with(presidential_debates_2012, readability(dialogue, NULL)))
# 
# (x2 <- with(presidential_debates_2012, readability(dialogue, list(person, time))))
# plot(x2)
# 
# (x2b <- with(presidential_debates_2012, readability(dialogue, list(person, time),
#     order.by.readability = FALSE)))
# 
# (x3 <- with(presidential_debates_2012, readability(dialogue, TRUE)))
# ## End(Not run)

Run the code above in your browser using DataLab