24 Distance Between Savior Names, Part 2
Readings
- Cheat sheet and other documentation for purrr package
- (optional) For a deeper discussion of purrr vs. for loops read R for Data Science Chapter 21. Section 21.5 focuses on the
map()
if you want a quick summary/review of that function. - The Book of Mormon. This link is for reference only. You don’t have to read the full BOM before completing this assignment.
Guided Instruction
Review/complete the guided instruction for the other tasks in this module if you have not yet.
In 1978 Susan Easton Black stated, “Even statistically, he [Christ] is the dominant figure of the Book of Mormon.”
With our “string” skills we are going to check her results and build an improved statistic using number of words between references.
- Get the scripture text and savior name data into R. This is the exact same same scripture and Savior name data used in the “Distance Between Savior Names Part 1” task. (The code and data to read in the code is found there)
- Our ultimate goal will be to display the distribution of the distance between savior names for each book in the Book of Mormon (i.e. 15 different distributions). Ideally the plot should facilitate easy comparison between the distributions.
- This is very similar to what we did in Part 1 task, except that there is a distribution for each book (15 total distributions) instead of just 1 overall distribution for the entire Book of Mormon text.
- Use the list of Savior names and the Book of Mormon text to find the distribution of words between references to the Savior for each book in the Book of Mormon.
- Split on each instance of a Savior name in the Book of Mormon.
- Then count the number of words between each instance.
- By nesting the data you can use the
purrr
package to do this efficiently while still keeping track of the book it belongs to - which is needed for the visualizations requested below.
- Create a plot that visualizes the distribution of words between references to the Savior for each book in the Book of Mormon.
- Create an
.qmd
file with one to two paragraphs summarizing your graphic that shows how the distance between Savior names is distributed in books of the Book of Mormon. - Render your `.qmd`, then push all the files created in the rendering process into your GitHub repository.
Submit
In I-learn submit a link to the .md
file on GitHub.