readability.num: Calculate readability

Description Usage Arguments Examples

View source: R/readability.num.R

Description

This function is a stripped down version of readability. It does not analyze text, but directly takes the values used by the formulae to calculate the readability measures.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
readability.num(txt.features = list(sentences = NULL, words = NULL, letters =
  c(all = 0, l5 = 0, l6 = 0), syllables = c(all = 0, s1 = 0, s2 = 0), punct =
  NULL, all.chars = NULL, prepositions = NULL, conjunctions = NULL, pronouns =
  NULL, foreign = NULL, TTR = NULL, FOG.hard.words = NULL, Bormuth.NOL = NULL,
  Dale.Chall.NOL = NULL, Harris.Jacobson.NOL = NULL, Spache.NOL = NULL),
  index = c("ARI", "Bormuth", "Coleman", "Coleman.Liau", "Dale.Chall",
  "Danielson.Bryan", "Dickes.Steiwer", "DRP", "ELF", "Farr.Jenkins.Paterson",
  "Flesch", "Flesch.Kincaid", "FOG", "FORCAST", "Fucks", "Harris.Jacobson",
  "Linsear.Write", "LIX", "nWS", "RIX", "SMOG", "Spache", "Strain",
  "Traenkle.Bailer", "TRI", "Tuldava", "Wheeler.Smith"), parameters = list(),
  ...)

Arguments

txt.features

A named list with statistical information on the text, or an object of class kRp.readability (only its desc slot will then be used). Valid values are:

sentences:

The number of sentences.

words:

The number of words.

letters:

A named vector providing the number of letters. Must contain a value called "all", the total number of letters, and several values called "l<digit>", giving the number of words with <digit> letters. To calculate all implemented measures with default parameters, you need at least the values "l5" (words with five or less letters) and "l6" (words with six letters).

syllables:

Similar to letters, but providing the number of syllables. Must contain a value called "all", the total number of syllables, and several values called "s<digit>", giving the number of words with <digit> syllables. To calculate all implemented measures with default parameters, you need at least the values "s1" and "s2". Only needed to calculate measures which need syllable count (see readability).

punct:

The number of punctuation characters. Only needed to calculate "TRI".

all.chars:

The number of all characters (including spaces). Only needed to calculate Danielson.Bryan.

prepositions:

The number of prepositions. Only needed to calculate "Coleman" and "Traenkle.Bailer".

conjunctions:

The number of conjunctions. Only needed to calculate "Traenkle.Bailer".

pronouns:

The number of pronouns. Only needed to calculate "Coleman".

foreign:

The number of foreign words. Only needed to calculate "TRI".

TTR:

The type-token ratio. Only needed to calculate "Dickes.Steiwer".

FOG.hard.words:

The number of hard words, counted according to FOG. Only needed to calculate "FOG".

Bormuth.NOL:

Number of words not on the Bormuth word list. Only needed to calculate "Bormuth".

Dale.Chall.NOL:

Number of words not on the Dale-Chall word list. Only needed to calculate "Dale.Chall".

Harris.Jacobson.NOL:

Number of words not on the Harris-Jacobson word list. Only needed to calculate "Harris.Jacobson".

Spache.NOL:

Number of words not on the Spache word list. Only needed to calculate "Spache".

index

A character vector, indicating which indices should actually be computed.

parameters

A named list with magic numbers, defining the relevant parameters for each index. If none are given, the default values are used.

...

Additional options, see readability.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
test.features <- list(
 sentences=18,
 words=556,
 letters=c(all=2918, l1=19, l2=92, l3=74, l4=80, l5=51, l6=49),
 syllables=c(all=974, s1=316, s2=116),
 punct=78,
 all.chars=3553,
 prepositions=74,
 conjunctions=18,
 pronouns=9,
 foreign=0,
 TTR=0.5269784,
 Bormuth.NOL=192,
 Dale.Chall.NOL=192,
 Harris.Jacobson.NOL=240,
 Spache.NOL=240)

# should not calculate FOG, because FOG.hard.words is missing:
readability.num(test.features, index="all")

## End(Not run)

Example output

Loading required package: data.table

Automated Readability Index (ARI)
  Parameters: default 
       Grade: 18.73 


Automated Readability Index (ARI)
  Parameters: NRI 
       Grade: 16.44 


Automated Readability Index (ARI)
  Parameters: simplified 
       Index: 78.12 


Bormuth Mean Cloze
  Parameters: default 
  Fam. words: 65%
  Mean Cloze: 23.52 
       Grade: 11.03 


Coleman Formulas
  Parameters: default 
    Pronouns: 1.62 (per 100 words)
     Prepos.: 13.31 (per 100 words)
   Formula 1: 35% cloze completions
   Formula 2: 33% cloze completions
   Formula 3: 32% cloze completions
   Formula 4: 33% cloze completions


Coleman-Liau
  Parameters: default 
         ECP: 33% (estimted cloze percentage)
       Grade: 14.1 
       Grade: 14.1 (short formula)


Dale-Chall Readability Formula
  Parameters: default 
 Not on list: 35%
   Raw value: 9.88 
       Grade: >= 16 (college graduate) 
         Age: >= 22 


Dale-Chall Readability Formula
  Parameters: Powers-Sumner-Kearl 
 Not on list: 35%
   Raw value: 9.1 
       Grade: 9-10 
         Age: 14-16 


Dale-Chall Readability Formula
  Parameters: Dale-Chall (1948) 
 Not on list: 35%
   Raw value: 10.62 
       Grade: >= 16 (college graduate) 
         Age: >= 22 


Danielson-Bryan
  Parameters: default 
         DB1: 9.86 
         DB2: 26.42 
       Grade: >= 13 (college) 


Dickes-Steiwer's Handformel
  Parameters: default 
         TTR: 0.53 
       Score: 32.3 


Degrees of Reading Power
         DRP: -2251.82 


Easy Listening Formula
  Parameters: default 
      Exsyls: 240 
       Score: 13.33 


Farr-Jenkins-Paterson
  Parameters: default 
          RE: 28.01 
       Grade: >= 16 (college graduate) 


Farr-Jenkins-Paterson
  Parameters: Powers-Sumner-Kearl 
       Grade: 7.6 


Flesch Reading Ease
  Parameters: en (Flesch) 
          RE: 27.28 
       Grade: >= 16 (college graduate) 


Flesch-PSK Reading Ease
  Parameters: Powers-Sumner-Kearl 
       Grade: 8.17 
         Age: 13.17 


Flesch-Szigriszt Reading Ease (es)
  Parameters: es (Szigriszt) 
          RE: 66.81 
       Grade: 8-9 


Flesch.de Reading Ease
  Parameters: de (Amstad) 
          RE: 46.63 
       Grade: >= 13 (college) 


Flesch.es Reading Ease
  Parameters: es (Fernandez-Huerta) 
          RE: 70.22 
       Grade: 7 


Flesch.fr Reading Ease
  Parameters: fr (Kandel-Moles) 
          RE: 54.36 
       Grade: >= 10 (high school) 


Flesch.nl Reading Ease
  Parameters: nl (Douma) 
          RE: 43.22 
       Grade: >= 13 (college) 


Flesch-Kincaid Grade Level
  Parameters: default 
       Grade: 17.13 
         Age: 22.13 


FORCAST
  Parameters: default 
       Grade: 11.47 
         Age: 16.47 


FORCAST
  Parameters: precise reading grade level 
       Grade: 11.05 
         Age: 16.05 


Fucks' Stilcharakteristik
       Score: 162.11 
       Grade: 12.73 


Harris-Jacobson
  Parameters: default 
 Not on list: 43%
        HJ 1: 9.75 
        HJ 2: 11.33 
        HJ 3: 7.12 
        HJ 4: 8.65 
        HJ 5: 10.76 


Linsear Write
  Parameters: default 
  Easy words: 77.7 
  Hard words: 22.3 
       Grade: 22.33 


L<U+00E4>sbarhetsindex (LIX)
  Parameters: default 
       Index: 65.24 
      Rating: very difficult 
       Grade: > 11 


Neue Wiener Sachtextformeln
  Parameters: default 
       nWS 1: 11.2 
       nWS 2: 11.61 
       nWS 3: 11.38 
       nWS 4: 12.63 


Readability Index (RIX)
  Parameters: default 
       Index: 10.61 
       Grade: > 12 (college) 


Simple Measure of Gobbledygook (SMOG)
  Parameters: default 
       Grade: 18.12 
         Age: 23.12 


Simple Measure of Gobbledygook (SMOG)
  Parameters: de ("Qu", Bamberger-Vanecek) 
       Grade: 12.38 
         Age: 17.38 


Simple Measure of Gobbledygook (SMOG)
  Parameters: Fomula C 
       Grade: 17.41 
         Age: 22.41 


Simple Measure of Gobbledygook (SMOG)
  Parameters: simplified 
       Grade: 17.38 
         Age: 22.38 


Spache Formula
  Parameters: default 
 Not on list: 43%
       Grade: 7.94 


Spache Formula
  Parameters: First formula (1953) 
 Not on list: 43%
       Grade: 8.91 


Strain Index
  Parameters: default 
       Index: 16.23 


Tr<U+00E4>nkle-Bailer Formulas
   Parameters: default 
 Prepositions: 13%
 Conjunctions: 3%
         TB 1: 18.82 
         TB 2: 27.33 


Kuntzsch's Text-Redundanz-Index
  Parameters: default 
 Short words: 316 
 Punctuation: 78 
     Foreign: 0 
       Score: -64.96 


Tuldava's Text Difficulty Formula
  Parameters: default 
       Index: 6.01 


Wheeler-Smith
  Parameters: default 
       Score: 133.33 
       Grade: > 4 


Wheeler-Smith
  Parameters: de (Bamberger & Vanecek) 
       Score: 133.33 
       Grade: > 8 

Warning messages:
1: FOG: Missing data (FOG.hard.words), not calculated! 
2: FOG.NRI: Missing data (FOG.hard.words), not calculated! 
3: FOG.PSK: Missing data (FOG.hard.words), not calculated! 
4: Note: The implementations of these formulas are still subject to validation:
  ARI.simple, Coleman, Danielson.Bryan, Dickes.Steiwer, ELF, Flesch.de, Flesch.fr, Flesch.nl, Fucks, Harris.Jacobson, nWS, SMOG.C, SMOG.de, Strain, Traenkle.Bailer, TRI
  Use the results with caution, even if they seem plausible!
  See readability(index="validation") for more details. 

koRpus documentation built on May 30, 2017, 12:47 a.m.