Description Usage Arguments Examples
Takes a collection of chapters, breaks them up into individual chapters, and returns summary dataset for each chapter. Output statistics include average sentence length, average token length, average type length, average variety (# type/# token), story length (number of words), number of occurences of words (expressed as ratio of frequency of word over total number of words), number of occurances of punctuation (expressed as ratio of frequency of punctuation mark over all punctuation marks) and average sentiment score (AFINN method).
1 | make_analysis_df(text, book, chapters, titles, freqwords, punctlist)
|
text |
Character vector containing all the lines in a given text |
book |
Name of book or story collection from which chapters/stories are taken |
chapters |
Line index numbers associated with the first line/title line of each chapter |
titles |
Title of each story or chapter in output dataset |
freqwords |
Words whose frequency of appearance will be recorded |
punctlist |
Punctuation characters whose frequency of appearance will be recorded |
1 2 3 4 5 6 7 8 | sample <- gardenParty[1:452]
collection <- "The Garden Party"
breaks <- find_chapters(sample, " and other stories, by Katherine Mansfield : ")
stories <- c("At the Bay", "Her First Ball", "The Singing Lesson")
words <- c("the", "and", "a")
punctuation <- c(",", ".", "...")
make_analysis_df(text = sample, book = collection, chapters = breaks, titles = stories,
freqwords = words, punctlist = punctuation)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.