<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/clustering-the-bible/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.ephorie.de/clustering-the-bible"> R-Bloggers – Learning Machines</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div data-backend-url="http://blog.ephorie.de/wp-content/plugins/shariff-sharing/backend/index.php" data-temp="/tmp" data-orientation="horizontal" data-lang="en" data-theme="color" data-service="gftlr" data-services="[&quot;googleplus&quot;,&quot;facebook&quot;,&quot;twitter&quot;,&quot;linkedin&quot;,&quot;reddit&quot;,&quot;whatsapp&quot;,&quot;mail&quot;,&quot;info&quot;]" data-title="Clustering the Bible" data-info-url="http://ct.de/-2467514" data-ttl="60" data-url="http://blog.ephorie.de/clustering-the-bible" data-image="http://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering-1024x731.pnghttp://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering-1024x731.png 1024w, http://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering-300x214.png 300w, http://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering-768x549.png 768w, http://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering-1200x857.png 1200w, http://blog.ephorie.de/wp-content/uploads/2018/12/NT-clustering.png 1344w"></div>
<p>During this time of year there is obviously a lot of talk about the Bible. As most people know the New Testament comprises four different Gospels written by anonymous authors 40 to 70 years after Jesus’ supposed crucifiction. Unfortunately we have lost all of the originals but only retained copies of copies of copies (and so on) which date back hundreds of years after they were written in all kinds of different versions (renowned Biblical scholar Professor Bart Ehrmann states that there are more versions of the New Testament than there are words in the New Testament). Just as a fun fact: there are many more Gospels but only those four were included in the official Bible.</p>
<p>So in general it is interesting to learn a little bit more about this stuff, especially because, for better or worse, it is at the core of Western civilization. One interesting question is how do the four Gospels relate to each other. To find that out you could either study ancient Greek and Christian theology for many years and decades – or you could use the <code>stylo</code> package and do a cluster analysis within seconds. Obviously we go for the latter…</p>
<p>For that matter we download one version of the four Gospels from <a rel="nofollow" href="https://www.gutenberg.org/" target="_blank">Project Gutenberg</a> in the original ancient Greek and put it into a separate directory called ‘corpus’ (which is the name of the default directory of the package). The famous beginning of the Gospel of John (“In the beginning was the Word, and the Word was with God, and the Word was God…”) reads as follows in Ancient Greek:</p>
<blockquote>
<p> Στην αρχή ‘ταν ο λόγος κι’ ο λόγος είτανε με το<br>
Θεό και Θεός είταν ο λόγος. Είταν εκείνος στην αρχή<br>
με το Θεό. Όλα τα πάντα μέσο του έγιναν, και χωρίς<br>
του τίποτα δεν έγινε που γίνηκε. Μέσα του είτανε ζωή<br>
κι’ η ζωή ‘τανε το φως των ανθρώπων, και το φως<br>
μέσα στο σκοτάδι φέγγει και το σκοτάδι δεν το κυρίεψε.</p>
</blockquote>
<p>For your convenience I provide you with the curated texts here: <a rel="nofollow" href="http://blog.ephorie.de/wp-content/uploads/2018/12/John.txt" target="_blank">John</a>, <a rel="nofollow" href="http://blog.ephorie.de/wp-content/uploads/2018/12/Luke.txt" target="_blank">Luke</a>, <a rel="nofollow" href="http://blog.ephorie.de/wp-content/uploads/2018/12/Mark.txt" target="_blank">Mark</a>, <a rel="nofollow" href="http://blog.ephorie.de/wp-content/uploads/2018/12/Matthew.txt" target="_blank">Matthew</a>.</p>
<p>After that we can already call the main function of the package:</p>
<pre>
library(stylo)

## ### stylo version: 0.6.8 ###
## 
## If you plan to cite this software (please do!), use the following reference:
##     Eder, M., Rybicki, J. and Kestemont, M. (2016). Stylometry with R:
##     a package for computational text analysis. R Journal 8(1): 107-121.
##     </pre>