<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/more-water-a-bit-more-about-saints/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://masalmon.github.io/2017/01/26/morewater/"> Maëlle</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>I was lucky enough to get some nice and interesting feedback on <a target="_blank" rel="nofollow" href="http://www.masalmon.eu/2017/01/24/kervillebourg/">my last post</a>. One comment was really useful and pretty embarrassing: I had written “see” instead of “sea” in the whole post… Thanks Steve Dempsey for the correction! I also got some questions which I decided to explore.</p>
<p><span></span></p>
<h1>More water?</h1>
<p>I had chosen to look specifically for a few rivers but one commenter, actually Steve Dempsey again, asked me how it would look like if I systematically retrieved all placenames with “sur-“, “upon”, because where he lived in France there were many “sur-Dronne” or “sur l’Isle”. He actually asked the question in French, <em>“Je me demande ce que ça donne avec tous les places avec un “-sur”. Là, où j’étais en France il y avait plein de “-sur-Dronne” ou “-sur-l’Isle”.”</em> Let’s see! (or sea? just kidding)</p>
<div>
<pre><code><span>library</span><span>(</span><span>&quot;dplyr&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;tidyr&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;readr&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;purrr&quot;</span><span>)</span><span>
</span><span>ville</span><span> </span><span>&lt;-</span><span> </span><span>read_tsv</span><span>(</span><span>&quot;data/2017-01-24-kervillebourg_FR.txt&quot;</span><span>,</span><span> </span><span>col_names</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>)[,</span><span> </span><span>c</span><span>(</span><span>2</span><span>,</span><span> </span><span>5</span><span>,</span><span> </span><span>6</span><span>)]</span><span>
</span><span>names</span><span>(</span><span>ville</span><span>)</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;placename&quot;</span><span>,</span><span> </span><span>&quot;latitude&quot;</span><span>,</span><span> </span><span>&quot;longitude&quot;</span><span>)</span><span>
</span><span>ville</span><span> </span><span>&lt;-</span><span> </span><span>unique</span><span>(</span><span>ville</span><span>)</span><span>
</span><span>upon</span><span> </span><span>&lt;-</span><span> </span><span>filter</span><span>(</span><span>ville</span><span>,</span><span> </span><span>grepl</span><span>(</span><span>&quot;sur-&quot;</span><span>,</span><span> </span><span>placename</span><span>))</span><span>
</span></code></pre>
</div>
<p>If truth be told, I thought I’d just need to filter the relevant placenames and then get nice rivers on my map… nope. So I soon realized I should first find unique names of rivers, then group them by name and only draw the ones that have enough places for the map to be at least a bit pretty.</p>
<div>
<pre><code><span>upon</span><span> </span><span>&lt;-</span><span> </span><span>by_row</span><span>(</span><span>upon</span><span>,</span><span> </span><span>function</span><span>(</span><span>df</span><span>){</span><span>
</span><span>sub</span><span>(</span><span>&quot;.*sur-&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>df</span><span>$</span><span>placename</span><span>)</span><span>
</span><span>},</span><span> </span><span>.to</span><span> </span><span>=</span><span> </span><span>&quot;waterthing&quot;</span><span>,</span><span> </span><span>.collate</span><span> </span><span>=</span><span> </span><span>&quot;cols&quot;</span><span>)</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>(</span><span>head</span><span>(</span><span>upon</span><span>))</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>placename</th>
<th>latitude</th>
<th>longitude</th>
<th>waterthing</th>
</tr>
</thead>
<tbody>
<tr>
<td>Domecy-sur-le-Vault</td>
<td>47.49084</td>
<td>3.80953</td>
<td>le-Vault</td>
</tr>
<tr>
<td>Yzeures-sur-Creuse</td>
<td>46.78609</td>
<td>0.87166</td>
<td>Creuse</td>
</tr>
<tr>
<td>Yville-sur-Seine</td>
<td>49.39938</td>
<td>0.87750</td>
<td>Seine</td>
</tr>
<tr>
<td>Wingen-sur-Moder</td>
<td>48.91900</td>
<td>7.37955</td>
<td>Moder</td>
</tr>
<tr>
<td>Willer-sur-Thur</td>
<td>47.84392</td>
<td>7.07223</td>
<td>Thur</td>
</tr>
<tr>
<td>Wavrans-sur-Ternoise</td>
<td>50.41322</td>
<td>2.30002</td>
<td>Ternoise</td>
</tr>
</tbody>
</table>
<p>Let’s see what the more frequent <em>watherthings</em> are:</p>
<div>
<pre><code><span>group_by</span><span>(</span><span>upon</span><span>,</span><span> </span><span>waterthing</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarize</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>arrange</span><span>(</span><span>desc</span><span>(</span><span>n</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>head</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>20</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>waterthing</th>
<th>n</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mer</td>
<td>214</td>
</tr>
<tr>
<td>Loire</td>
<td>152</td>
</tr>
<tr>
<td>Seine</td>
<td>148</td>
</tr>
<tr>
<td>Marne</td>
<td>117</td>
</tr>
<tr>
<td>Meuse</td>
<td>88</td>
</tr>
<tr>
<td>Saône</td>
<td>70</td>
</tr>
<tr>
<td>Sarthe</td>
<td>50</td>
</tr>
<tr>
<td>Aube</td>
<td>44</td>
</tr>
<tr>
<td>Cher</td>
<td>41</td>
</tr>
<tr>
<td>Orne</td>
<td>39</td>
</tr>
<tr>
<td>Seille</td>
<td>39</td>
</tr>
<tr>
<td>Moselle</td>
<td>36</td>
</tr>
<tr>
<td>Eure</td>
<td>34</td>
</tr>
<tr>
<td>Yonne</td>
<td>33</td>
</tr>
<tr>
<td>Oise</td>
<td>32</td>
</tr>
<tr>
<td>Vienne</td>
<td>31</td>
</tr>
<tr>
<td>Garonne</td>
<td>30</td>
</tr>
<tr>
<td>Dordogne</td>
<td>28</td>
</tr>
<tr>
<td>Aisne</td>
<td>26</td>
</tr>
<tr>
<td>Allier</td>
<td>24</td>
</tr>
</tbody>
</table>
<p>So I find “Sea” again, and the rivers I had chosen in the last post, and others, whose names I all knew so they must be quite important. I want to keep only the rivers with “enough”” places to make the map pretty, because at the scale of the country I prefer seeing a longer river.</p>
<div>
<pre><code><span>upon</span><span> </span><span>&lt;-</span><span> </span><span>group_by</span><span>(</span><span>upon</span><span>,</span><span> </span><span>waterthing</span><span>)</span><span>
</span><span>upon</span><span> </span><span>&lt;-</span><span> </span><span>filter</span><span>(</span><span>upon</span><span>,</span><span> </span><span>n</span><span>()</span><span> </span><span>>=</span><span> </span><span>25</span><span>)</span><span>
</span><span>upon</span><span> </span><span>&lt;-</span><span> </span><span>ungroup</span><span>(</span><span>upon</span><span>)</span><span>
</span></code></pre>
</div>
<div>
<pre><code><span>library</span><span>(</span><span>&quot;ggplot2&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;ggmap&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;viridis&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>&quot;ggthemes&quot;</span><span>)</span><span>
</span><span>map</span><span> </span><span>&lt;-</span><span> </span><span>ggmap</span><span>::</span><span>get_map</span><span>(</span><span>location</span><span> </span><span>=</span><span> </span><span>&quot;France&quot;</span><span>,</span><span> </span><span>zoom</span><span> </span><span>=</span><span> </span><span>6</span><span>,</span><span> </span><span>maptype</span><span> </span><span>=</span><span> </span><span>&quot;watercolor&quot;</span><span>)</span><span>
</span></code></pre>
</div>
<p>This time the map will be really artsier than useful since I’ll have a color by river but no legend because of the higher numbers of rivers.</p>
<div>
<pre><code><span>p</span><span> </span><span>&lt;-</span><span> </span><span>ggmap</span><span>(</span><span>map</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>upon</span><span>,</span><span>
</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>longitude</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>latitude</span><span>,</span><span>
</span><span>col</span><span> </span><span>=</span><span> </span><span>waterthing</span><span>),</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>1.3</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme_map</span><span>()</span><span>+</span><span>
</span><span>scale_colour_grey</span><span>(</span><span>end</span><span> </span><span>=</span><span> </span><span>0.7</span><span>)</span><span>+</span><span> </span><span>ggtitle</span><span>(</span><span>&quot;French placenames containing the word 'sur'&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>plot.title</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>lineheight</span><span>=</span><span>1</span><span>,</span><span> </span><span>face</span><span>=</span><span>&quot;bold&quot;</span><span>))</span><span>+</span><span>
</span><span>theme</span><span>(</span><span>text</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>size</span><span>=</span><span>14</span><span>),</span><span>
</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;none&quot;</span><span>)</span><span>
</span><span>p</span><span>
</span></code></pre>
</div>
<p><img alt="plot of chunk unnamed-chunk-7" src="https://i1.wp.com/masalmon.github.io/figure/source/2017-01-26-morewater/unnamed-chunk-7-1.png?w=456" data-recalc-dims="1"></p>
<p>I like this map because I could find the rivers again without having to enter their names, and it looks like drawing with a pencil on watercolor without making any effort. However, since I’m not very good in geography, I’d like to add labels to each river, let’s say somewhere in the middle of the river. I’ll use <code>ggrepel</code> to avoid having overlapping labels. My definition of “somewhere in the middle” is sorting the places of a river by latitude and longitude and then choosing a place close to the middle.</p>
<div>
<pre><code><span>library</span><span>(</span><span>&quot;ggrepel&quot;</span><span>)</span><span>
</span><span>named_upon</span><span> </span><span>&lt;-</span><span> </span><span>arrange</span><span>(</span><span>upon</span><span>,</span><span> </span><span>latitude</span><span>,</span><span> </span><span>longitude</span><span>)</span><span>
</span><span>named_upon</span><span> </span><span>&lt;-</span><span> </span><span>group_by</span><span>(</span><span>named_upon</span><span>,</span><span> </span><span>waterthing</span><span>)</span><span>
</span><span>named_upon</span><span> </span><span>&lt;-</span><span> </span><span>mutate</span><span>(</span><span>named_upon</span><span>,</span><span> </span><span>index</span><span> </span><span>=</span><span> </span><span>1</span><span>:</span><span>n</span><span>())</span><span>
</span><span>named_upon</span><span> </span><span>&lt;-</span><span> </span><span>mutate</span><span>(</span><span>named_upon</span><span>,</span><span> </span><span>name</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>index</span><span> </span><span>==</span><span> </span><span>floor</span><span>(</span><span>n</span><span>()</span><span>/</span><span>2</span><span>),</span><span>
</span><span>waterthing</span><span>,</span><span> </span><span>NA</span><span>))</span><span>
</span><span>p</span><span> </span><span>+</span><span> </span><span>geom_label_repel</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>longitude</span><span>,</span><span>
</span><span>y</span><span> </span><span>=</span><span> </span><span>latitude</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>name</span><span>,</span><span>
</span><span>max.iter</span><span> </span><span>=</span><span> </span><span>20000</span><span>),</span><span>
</span><span>data</span><span> </span><span>=</span><span> </span><span>named_upon</span><span>)</span><span>
</span></code></pre>
</div>
<p><img alt="plot of chunk unnamed-chunk-8" src="https://i2.wp.com/masalmon.github.io/figure/source/2017-01-26-morewater/unnamed-chunk-8-1.png?w=456" data-recalc-dims="1"></p>
<p>Okay, I’ll now look at the map and learn the names! I’ve lived near the Loire, near the Seine and near the Marne. It might be surprising not to see the Rhine on that map, but placenames in Alsace are often more Germanic, so that would be another story.</p>
<h1>Which saints?</h1>
<p>I also got questions about saints, one <a target="_blank" rel="nofollow" href="https://twitter.com/anboa4/status/824174331777478657">on Twitter from Andrew Boa</a> and a few ones from Andrew MacDonald.</p>
<p>Andrew Boa’s question was the easiest one: how many unique names of saints are there? The questions of the other Andrew were <em>“I wonder, would it be possible to also obtain data on how old these towns are? It would be interesting to see if the gender of popular saints changes over time.<br>
Or, more simply, which saints have the most towns? I imagine there are tons of “Saint Sernin”s in the South, and probably lots of “Jeanne-d’Arc”s all over”</em>. Let me tell you I am thankful for the more simply part of the questions because I have no idea where one would find information about the age of the places. Nonetheless, this would be really interesting.</p>
<p>Let’s answer the questions about the number of unique names and their frequencies. I am now in particular curious about <em>André</em> since I got questions from two <em>Andrew</em>’s.</p>
<p>Note that for finding the name I remove the “Saint-“ or “Sainte-“ part but also everything that could come after another hyphen and a space, e.g. in “Alban-de-Varèze” which I want as “Alban”. Also note that in this analysis I ignore homonym saints, and that Jeanne d’Arc might be a saint, the places named after her don’t contain the word “sainte”.</p>
<div>
<pre><code><span>saints</span><span> </span><span>&lt;-</span><span> </span><span>ville</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>saint</span><span> </span><span>=</span><span> </span><span>grepl</span><span>(</span><span>&quot;Saint-&quot;</span><span>,</span><span> </span><span>placename</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>sainte</span><span> </span><span>=</span><span> </span><span>grepl</span><span>(</span><span>&quot;Sainte-&quot;</span><span>,</span><span> </span><span>placename</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>&quot;gender&quot;</span><span>,</span><span> </span><span>&quot;yes&quot;</span><span>,</span><span> </span><span>saint</span><span>:</span><span>sainte</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>yes</span><span> </span><span>==</span><span> </span><span>TRUE</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>-</span><span> </span><span>yes</span><span>)</span><span>
</span><span>saints</span><span> </span><span>&lt;-</span><span> </span><span>by_row</span><span>(</span><span>saints</span><span>,</span><span> </span><span>function</span><span>(</span><span>df</span><span>){</span><span>
</span><span>if</span><span>(</span><span>df</span><span>$</span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;saint&quot;</span><span>){</span><span>
</span><span>name</span><span> </span><span>&lt;-</span><span> </span><span>sub</span><span>(</span><span>&quot;.*Saint-&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>df</span><span>$</span><span>placename</span><span>)</span><span>
</span><span>}</span><span>else</span><span>{</span><span>
</span><span>name</span><span> </span><span>&lt;-</span><span> </span><span>sub</span><span>(</span><span>&quot;.*Sainte-&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>df</span><span>$</span><span>placename</span><span>)</span><span>
</span><span>}</span><span>
</span><span>name</span><span> </span><span>&lt;-</span><span> </span><span>trimws</span><span>(</span><span>name</span><span>)</span><span>
</span><span>name</span><span> </span><span>&lt;-</span><span> </span><span>strsplit</span><span>(</span><span>name</span><span>,</span><span> </span><span>&quot;-&quot;</span><span>)[[</span><span>1</span><span>]][</span><span>1</span><span>]</span><span>
</span><span>name</span><span> </span><span>&lt;-</span><span> </span><span>strsplit</span><span>(</span><span>name</span><span>,</span><span> </span><span>&quot; &quot;</span><span>)[[</span><span>1</span><span>]][</span><span>1</span><span>]</span><span>
</span><span>return</span><span>(</span><span>name</span><span>)</span><span>
</span><span>},</span><span> </span><span>.to</span><span> </span><span>=</span><span> </span><span>&quot;saintname&quot;</span><span>,</span><span> </span><span>.collate</span><span> </span><span>=</span><span> </span><span>&quot;cols&quot;</span><span>)</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>(</span><span>head</span><span>(</span><span>saints</span><span>))</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>placename</th>
<th>latitude</th>
<th>longitude</th>
<th>gender</th>
<th>saintname</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ygos-Saint-Saturnin</td>
<td>43.97651</td>
<td>-0.73780</td>
<td>saint</td>
<td>Saturnin</td>
</tr>
<tr>
<td>Canal de Vitry-le-François à Saint-Dizier</td>
<td>48.73333</td>
<td>4.60000</td>
<td>saint</td>
<td>Dizier</td>
</tr>
<tr>
<td>Vitrac-Saint-Vincent</td>
<td>45.79585</td>
<td>0.49356</td>
<td>saint</td>
<td>Vincent</td>
</tr>
<tr>
<td>Vineuil-Saint-Firmin</td>
<td>49.20024</td>
<td>2.49567</td>
<td>saint</td>
<td>Firmin</td>
</tr>
<tr>
<td>Villotte-Saint-Seine</td>
<td>47.42893</td>
<td>4.70571</td>
<td>saint</td>
<td>Seine</td>
</tr>
<tr>
<td>Villiers-Saint-Denis</td>
<td>49.00000</td>
<td>3.26667</td>
<td>saint</td>
<td>Denis</td>
</tr>
</tbody>
</table>
<p>How many unique names do we have?</p>
<div>
<pre><code><span>group_by</span><span>(</span><span>saints</span><span>,</span><span> </span><span>gender</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarize</span><span>(</span><span>n_names</span><span> </span><span>=</span><span> </span><span>length</span><span>(</span><span>unique</span><span>(</span><span>saintname</span><span>)),</span><span>
</span><span>n_places</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>gender</th>
<th>n_names</th>
<th>n_places</th>
</tr>
</thead>
<tbody>
<tr>
<td>saint</td>
<td>1205</td>
<td>10310</td>
</tr>
<tr>
<td>sainte</td>
<td>157</td>
<td>971</td>
</tr>
</tbody>
</table>
<p>Let’s look at the distributions of number of places by saint name, separately for <em>saints</em> then <em>saintes</em>.</p>
<div>
<pre><code><span>saints_freq</span><span> </span><span>&lt;-</span><span> </span><span>group_by</span><span>(</span><span>saints</span><span>,</span><span> </span><span>gender</span><span>,</span><span> </span><span>saintname</span><span>)</span><span> </span><span>saints_freq</span><span> </span><span>&lt;-</span><span> </span><span>summarize</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>n_places</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span>
</span><span>filter</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;saint&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_histogram</span><span>(</span><span>aes</span><span>(</span><span>n_places</span><span>))</span><span>
</span></code></pre>
</div>
<div>
<pre><code>## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
</code></pre>
</div>
<p><img alt="plot of chunk unnamed-chunk-11" src="https://i1.wp.com/masalmon.github.io/figure/source/2017-01-26-morewater/unnamed-chunk-11-1.png?w=456" data-recalc-dims="1"></p>
<div>
<pre><code><span>filter</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;sainte&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_histogram</span><span>(</span><span>aes</span><span>(</span><span>n_places</span><span>))</span><span>
</span></code></pre>
</div>
<div>
<pre><code>## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
</code></pre>
</div>
<p><img alt="plot of chunk unnamed-chunk-11" src="https://i2.wp.com/masalmon.github.io/figure/source/2017-01-26-morewater/unnamed-chunk-11-2.png?w=456" data-recalc-dims="1"></p>
<p>The information I get from looking at these ugly histograms is that there are some names that are very popular and a lot of them that are rarely used. Let’s look at the 11 more popular ones for <em>saints</em> and <em>saintes</em>. Don’t ask me why I chose 11!</p>
<div>
<pre><code><span>arrange</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>desc</span><span>(</span><span>n_places</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;saint&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>head</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>11</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>gender</th>
<th>saintname</th>
<th>n_places</th>
</tr>
</thead>
<tbody>
<tr>
<td>saint</td>
<td>Martin</td>
<td>618</td>
</tr>
<tr>
<td>saint</td>
<td>Jean</td>
<td>416</td>
</tr>
<tr>
<td>saint</td>
<td>Pierre</td>
<td>391</td>
</tr>
<tr>
<td>saint</td>
<td>Germain</td>
<td>304</td>
</tr>
<tr>
<td>saint</td>
<td>Julien</td>
<td>219</td>
</tr>
<tr>
<td>saint</td>
<td>Laurent</td>
<td>215</td>
</tr>
<tr>
<td>saint</td>
<td>Georges</td>
<td>214</td>
</tr>
<tr>
<td>saint</td>
<td>Hilaire</td>
<td>181</td>
</tr>
<tr>
<td>saint</td>
<td>Aubin</td>
<td>169</td>
</tr>
<tr>
<td>saint</td>
<td>Michel</td>
<td>168</td>
</tr>
<tr>
<td>saint</td>
<td>André</td>
<td>164</td>
</tr>
</tbody>
</table>
<p>So for <em>saints</em> I see names that are still common in France. And <em>André</em> as 11th one, which might explain why I chose the 11 most popular ones…</p>
<div>
<pre><code><span>arrange</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>desc</span><span>(</span><span>n_places</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;sainte&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>head</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>11</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>gender</th>
<th>saintname</th>
<th>n_places</th>
</tr>
</thead>
<tbody>
<tr>
<td>sainte</td>
<td>Marie</td>
<td>122</td>
</tr>
<tr>
<td>sainte</td>
<td>Croix</td>
<td>69</td>
</tr>
<tr>
<td>sainte</td>
<td>Colombe</td>
<td>68</td>
</tr>
<tr>
<td>sainte</td>
<td>Marguerite</td>
<td>52</td>
</tr>
<tr>
<td>sainte</td>
<td>Anne</td>
<td>50</td>
</tr>
<tr>
<td>sainte</td>
<td>Foy</td>
<td>36</td>
</tr>
<tr>
<td>sainte</td>
<td>Eulalie</td>
<td>29</td>
</tr>
<tr>
<td>sainte</td>
<td>Gemme</td>
<td>25</td>
</tr>
<tr>
<td>sainte</td>
<td>Geneviève</td>
<td>24</td>
</tr>
<tr>
<td>sainte</td>
<td>Catherine</td>
<td>21</td>
</tr>
<tr>
<td>sainte</td>
<td>Radegonde</td>
<td>20</td>
</tr>
</tbody>
</table>
<p>I’m fascinated by some names like <em>Radegonde</em> that are not common any longer.</p>
<p>And since looking at rare names is so fun (isn’t it?), let’s look at the 11th of the least popular names.</p>
<div>
<pre><code><span>arrange</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>n_places</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;saint&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>head</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>11</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>gender</th>
<th>saintname</th>
<th>n_places</th>
</tr>
</thead>
<tbody>
<tr>
<td>saint</td>
<td>Aaron</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Alexis</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Alvard</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Amas</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Amond</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Anastase</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Andre´</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Andrieu</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Andrieux</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Anne</td>
<td>1</td>
</tr>
<tr>
<td>saint</td>
<td>Apoll</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>I think some rare names might be errors of accents, e.g. <em>Andre</em> might be <em>André</em> and seeing <em>Anne</em> in the list of <em>saints</em> I’m now wondering about the number of female names classified as <em>saints</em> in the dataset. There are 10 “Saint Mary” in the dataset and 122 “Sainte Marie” so I think the gender inbalance would still exist when accounting for this, but it’s certainly a good point to keep in mind when using this Geonames dataset! If I were to really tackle the issue, I think I’d try using the <a target="_blank" rel="nofollow" href="https://github.com/kalimu/genderizeR"><code>genderizer</code></a> package on names, although I’m not so sure it’d perform well for French old names and the <a target="_blank" rel="nofollow" href="https://github.com/ropensci/gender">rOpensci gender package</a> doesn’t have an historical dataset for France (yet?). I could also simply look for a very French dataset of place names, and hope no name would be translated in it.</p>
<p>Beside discovering this limitation of the dataset, I liked the names one can see by browsing the least popular saint names, like <em>Eusoge</em> or <em>Exupère</em>.</p>
<div>
<pre><code><span>arrange</span><span>(</span><span>saints_freq</span><span>,</span><span> </span><span>n_places</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>gender</span><span> </span><span>==</span><span> </span><span>&quot;sainte&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>head</span><span>(</span><span>n</span><span> </span><span>=</span><span> </span><span>11</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>knitr</span><span>::</span><span>kable</span><span>()</span><span>
</span></code></pre>
</div>
<table>
<thead>
<tr>
<th>gender</th>
<th>saintname</th>
<th>n_places</th>
</tr>
</thead>
<tbody>
<tr>
<td>sainte</td>
<td>Ame</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Assise</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Avoye</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Awawa</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Blaizine</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Clotilde</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Élisabeth</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Éturien</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Eugienne</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Eulard</td>
<td>1</td>
</tr>
<tr>
<td>sainte</td>
<td>Genevieve</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>This is similarly fascinating and also shows me it might be interesting to re-analyse the all dataset without diacritical accents (<em>Genevieve</em> should be <em>Geneviève</em>).</p>
<p>And <em>Saint Maël</em>, you might ask? Well <em>Maël</em> or <em>Maëlle</em> are Breton names so there’s no place called <em>Saint Maël</em> in the dataset like my holy patron, but there is <em>Maël-Carhaix</em> and <em>Maël-Pestivien</em>. I can’t speak Breton, <a target="_blank" rel="nofollow" href="https://fr.wikipedia.org/wiki/Ma%C3%ABl-Pestivien#Toponymie">Wikipedia</a> tells me that <em>Pestivien</em> means “the end of the sources” and <a target="_blank" rel="nofollow" href="https://fr.wikipedia.org/wiki/Carhaix-Plouguer#Toponymie">for Carhaix</a> it seems to be a long story. After looking at this dataset, I have the impression that the more toponomy questions one tries to answer, the more new questions one has. While this is awesome because of all the learning it implies, I’ll conclude this post (and probably my hobby career as a toponomist :)) by simply plotting the <em>Jeanne d’Arc</em> places for Andrew MacDonald, and <em>Domrémy-la-Pucelle</em> where she was born. There was no <em>Saint-Sermin</em>!</p>
<div>
<pre><code><span>ville</span><span> </span><span>&lt;-</span><span> </span><span>mutate</span><span>(</span><span>ville</span><span>,</span><span> </span><span>jeanne</span><span> </span><span>=</span><span> </span><span>grepl</span><span>(</span><span>&quot;Jeanne [dD].[aA]rc&quot;</span><span>,</span><span> </span><span>placename</span><span>))</span><span>
</span><span>ville</span><span> </span><span>&lt;-</span><span> </span><span>mutate</span><span>(</span><span>ville</span><span>,</span><span> </span><span>domremy</span><span> </span><span>=</span><span> </span><span>(</span><span>placename</span><span> </span><span>==</span><span> </span><span>&quot;Domrémy-la-Pucelle&quot;</span><span>))</span><span>
</span><span>jeanne</span><span> </span><span>&lt;-</span><span> </span><span>filter</span><span>(</span><span>ville</span><span>,</span><span> </span><span>jeanne</span><span> </span><span>|</span><span> </span><span>domremy</span><span>)</span><span>
</span><span>jeanne</span><span> </span><span>&lt;-</span><span> </span><span>tidyr</span><span>::</span><span>gather</span><span>(</span><span>jeanne</span><span>,</span><span> </span><span>&quot;word&quot;</span><span>,</span><span> </span><span>&quot;value&quot;</span><span>,</span><span> </span><span>jeanne</span><span>:</span><span>domremy</span><span>)</span><span>
</span><span>jeanne</span><span> </span><span>&lt;-</span><span> </span><span>filter</span><span>(</span><span>jeanne</span><span>,</span><span> </span><span>value</span><span>)</span><span>
</span><span>ggmap</span><span>(</span><span>map</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>data</span><span> </span><span>=</span><span> </span><span>jeanne</span><span>,</span><span>
</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>longitude</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>latitude</span><span>,</span><span> </span><span>col</span><span> </span><span>=</span><span> </span><span>word</span><span>),</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>3</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme_map</span><span>()</span><span>+</span><span> </span><span>ggtitle</span><span>(</span><span>&quot;French placenames containing 'Jeanne d'Arc'&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>plot.title</span><span> </span><span>=</span><span> </span><span>element_text</span><span>(</span><span>lineheight</span><span>=</span><span>1</span><span>,</span><span> </span><span>face</span><span>=</span><span>&quot;bold&quot;</span><span>))</span><span> </span><span>+</span><span>
</span><span>scale_color_viridis</span><span>(</span><span>discrete</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)</span><span>
</span></code></pre>
</div>
<p><img alt="plot of chunk unnamed-chunk-16" src="https://i2.wp.com/masalmon.github.io/figure/source/2017-01-26-morewater/unnamed-chunk-16-1.png?w=456" data-recalc-dims="1"></p>
<p>So there are a few Jeanne d’Arc places all over as predicted by Andrew, none very close to <em>Domrémy-la-Pucelle</em> but then this was called <em>Domrémy the virgin</em> after her already.</p>
<p>If you want to play with the dataset yourself, you’ll find it on Geonames, see <a target="_blank" rel="nofollow" href="https://gist.github.com/hrbrmstr/0fd37cf3825fc8e3eddf042a4443d1dc">this gist</a> and in the data folder of <a target="_blank" rel="nofollow" href="https://github.com/masalmon/kervillebourg">this Github repo</a>. If you do, don’t hesitate to share your findings!</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://masalmon.github.io/2017/01/26/morewater/"> Maëlle</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/tL1P4ZQc0PY"></a></div>