The first thing to do is load the following packages in R or RStudio.

library(tmap)
library(sp)
library(tmaptools)
library(ggplot2)
library(ggthemes)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(seriation)

Load the RData file C2.RData

You can find this file using the following link. Download it and place it within your workspace folder for R or RStudio. For instructions on how to set your workspace directory please use the following instructions.

load('C2.RData')

This will add all the datasets that were created for this chapter to your R workspace. As there are two samples in this chapter the naming conventions followed this approach: the datasets that are for the Enlisted sample start with ‘enlist’ and the datasets that are for the Officers sample start with ‘off’. For example the date of attesation file for the enlisted sample is called ‘enlist_attest’.

head(enlist_attest)
##   Date.of.Attestation month
## 1          1922-07-14     7
## 2          1922-07-17     7
## 3          1922-07-19     7
## 4          1922-07-19     7
## 5          1922-07-22     7
## 6          1922-08-01     8

Most of the datasets were originally created in wide format files as shown in the example of enlist_rank_comp which refers to the comparison between ranks held in different militaries.

head(enlist_rank_comp)
##                 X Volunteer Private Corporal Sergeant Other Blank
## 1   National Army        46       0        0        3     0     1
## 2    British Army         0      25        9        5     2     1
## 3 Royal Air Force         0       0        0        1     0     1
## 4   Canadian Army         0       0        0        0     0     1
## 5      Not Listed         0       0        0        0     5     0

It was necessary to change the file into long form data. This was done using the melt command in the package ‘reshape2’. The result is the dataset enlist_rank_c

require(reshape2)
## Loading required package: reshape2
enlist_rank_C <- melt(enlist_rank_comp)
## Using X as id variables
head(enlist_rank_C)
##                 X  variable value
## 1   National Army Volunteer    46
## 2    British Army Volunteer     0
## 3 Royal Air Force Volunteer     0
## 4   Canadian Army Volunteer     0
## 5      Not Listed Volunteer     0
## 6   National Army   Private     0

This process was repeated for the next enlisted dataset enlist_prevRB, which is a comparison of previous ranks by branch of military service.

head(enlist_prevRB)
##                 X Private Corporal Sergeant Other Blank
## 1    British Army      69       35       16     7     1
## 2 Royal Air Force       0        0        1     0     1
## 3   Royal Marines       0        0        2     0     0
## 4      Royal Navy       0        2        0     0     0
## 5   Canadian Army       0        0        0     0     1
## 6      Not Listed       0        0        0    11     0
enlist_prevRank <- melt(enlist_prevRB)
## Using X as id variables
head(enlist_prevRank)
##                 X variable value
## 1    British Army  Private    69
## 2 Royal Air Force  Private     0
## 3   Royal Marines  Private     0
## 4      Royal Navy  Private     0
## 5   Canadian Army  Private     0
## 6      Not Listed  Private     0

Here is the code for each of the graphs that utilise the three enlisted sample datasets outlined above

Note - Each graph utilises the colorblind setting for maximum accessibility

This is the first graph, showing monthly totals of recruitment.

ggplot(enlist_attest, aes(x=month)) + geom_bar() + scale_x_continuous(breaks = c(7,8,9,10,11,12), labels = c("July", "August", "September", "October", "November", "December")) +  labs(title= "Fig. 1 - Date of Attestation by Month Enlisted Sample", caption="Source: Sample of ex-Britishers - Miltiary Archives") + xlab("Monthly Totals") + ylab("Number of Recruits") + theme_economist() + theme(axis.text.x = element_text(colour = "darkslategrey", size = 10), axis.text.y = element_text(colour = "darkslategrey", size = 10),          text = element_text(family = "Georgia"),
          plot.title = element_text(size = 10, margin = margin(b = 10)),
          plot.subtitle = element_text(size = 12, color = "darkslategrey", margin = margin(b = 10)),
          plot.caption = element_text(size = 8, margin = margin(t = 10), color = "grey70", hjust = 0))

This is the second plot showing the previous ranks held in the different non-Irish militaries.

bertinplot(enlist_PREVB, options = list(shading=TRUE, panel = panel.bars, reverse = TRUE))

                                                                                                                            bertinplot(enlist_PREVB, s, options = list(shading=TRUE, panel = panel.bars, reverse = TRUE))

This is the third graph showing the comparison between ranks held in non-Irish militaries and the Irish National Army in 1922.

bertinplot(enlist_RC, options = list(shading=TRUE, panel = panel.bars, reverse = TRUE))

                                                                                                                        bertinplot(enlist_RC, t, options = list(shading=TRUE, panel = panel.bars, reverse = TRUE))

Repeat the same process used above when analysing the officer sample datasets

Each original dataset has been changed to a long format using the melt() command in the package reshape2.

head(off_rankCC)
##                          X Colonel Commandant Captain Lieutenant X1LT X2LT
## 1 Army Corps of Engineers        0          8      20         10    4    6
## 2        A.G.’s Department       0          1       4          4    1    1
## 3         Army Air Service       0          0       6          2    4    2
## 4          Athlone Command       0          1      10          0    2    2
## 5      Claremorris Command       1          3       9          1    7    4
## 6          Curragh Command       2          1       6          1    3    6
##   Cadet NoRank
## 1     1      2
## 2     0      0
## 3     0      0
## 4     0      0
## 5     0      0
## 6     0      0
head(off_yrservice)
##        year variable value
## 1   <1 year      IRA    12
## 2 1-5 years      IRA    96
## 3  5+ years      IRA     2
## 4  10+years      IRA     0
## 5   <1 year       BA     2
## 6 1-5 years       BA   139
head(off_recruit_typeX)
##                       X variable value
## 1            ex-British February     0
## 2 IRA & British Service February    11
## 3            ex-British    March     4
## 4 IRA & British Service    March    16
## 5            ex-British    April     4
## 6 IRA & British Service    April    13
head(off_rankcomp1)
##                    X       rank total
## 1 National Army 1922    Colonel     2
## 2 National Army 1923    Colonel     3
## 3 National Army 1922 Commandant     5
## 4 National Army 1923 Commandant     6
## 5 National Army 1922  Brigadier     1
## 6 National Army 1923  Brigadier     0

Here is the code used to create the graphs for each of the Officer sample datasets outlined above

This is a bertinplot that shows the amount of officers per command by type. It provides an effective overview of the distribution of the officers sample by specific commands and corps of the National Army. The first plot is ordered by the original file and the second plot is reorded using BEA.

bertinplot(off_rank_C, options = list(shading=TRUE, panel = panel.blocks, reverse = TRUE))

bertinplot(off_rank_C, o, options = list(shading=TRUE, panel = panel.blocks, reverse = TRUE))

This plot shows the amount of previous military service that each officer had listed before joining the National Army.

This graph is an overview of recruitment totals per month for the officers sample for 1922 and 1923.

ggplot(off_recruitX, aes(x=variable, y=value, fill= factor(X))) + geom_bar(stat = "identity", color="grey24", position = "dodge") + labs(fill="Year", labels=c("1922", "1923")) + scale_fill_colorblind() + xlab("Months") + ylab("No of Recruits") + ggtitle("Fig. 6 Dates of Attestation 1922 - 1923") + theme_economist() +
    theme(axis.text.x = element_text(colour = "darkslategrey", size = 6), axis.text.y = element_text(colour = "darkslategrey", size = 12),          text = element_text(family = "Georgia"),
          plot.title = element_text(size = 12, margin = margin(b = 10)),
          plot.subtitle = element_text(size = 12, color = "darkslategrey", margin = margin(b = 25)),
          plot.caption = element_text(size = 8, margin = margin(t = 10), color = "grey70", hjust = 0))

This graph shows the number of recruits, either ex-British military or ex-IRA & ex-British military, who joined the National Army per month for 1922.

ggplot(off_recruit_typeX, aes(x=variable, y=value, fill= factor(X))) + geom_bar(stat = "identity", color="grey24", position = "dodge") + labs(fill="Year", labels=c("ex-British", "ex-British/IRA")) + scale_fill_colorblind() + xlab("Months") + ylab("No of Recruits") + ggtitle("Fig. 7 Types of Recruits Feb - Dec 1922") + theme_economist() +
    theme(axis.text.x = element_text(colour = "darkslategrey", size = 6), axis.text.y = element_text(colour = "darkslategrey", size = 12),          text = element_text(family = "Georgia"),
          plot.title = element_text(size = 12, margin = margin(b = 10)),
          plot.subtitle = element_text(size = 12, color = "darkslategrey", margin = margin(b = 25)),
          plot.caption = element_text(size = 8, margin = margin(t = 10), color = "grey70", hjust = 0))

This is a bar chart showing the differences in the types of rank held by a sub-group of the Officers sample who were found listed on the Irish Army Census between 1922 and 1923.

ggplot(off_rankcomp1, aes(x=reorder(rank), y= total, fill= factor(X))) + geom_bar(stat = "identity", position = "dodge") + scale_fill_colorblind(name="Year") + ggtitle("Fig. 8 Comparison of ranks held in 1922 versus 1923 by sample of ex-British Officers") + xlab("Year") + ylab("No. of Officers") + theme_economist() +   theme(axis.text.x = element_text(colour = "darkslategrey", size = 4), axis.text.y = element_text(colour = "darkslategrey", size = 8),          text = element_text(family = "Georgia"),
          plot.title = element_text(size = 12, margin = margin(b = 10)),
          plot.subtitle = element_text(size = 12, color = "darkslategrey", margin = margin(b = 25)),
          plot.caption = element_text(size = 8, margin = margin(t = 10), color = "grey70", hjust = 0))

Mapping the Samples

Before the samples can be mapped, the totals need to be added to the ESRI shapefile. These totals are contained in a dataset called ‘address_total’

head(address_total)
##          county ADDR_MIX ADDR_TOTALMIL NOK_TOTALMIL ADDR_ENLIST ADDR_OFF
## 1 County Antrim        5           885          854         104        3
## 2 County Armagh        1           130          125          NA        2
## 3 County Carlow       NA           550          542          NA       NA
## 4  County Cavan        1           616          596          NA        3
## 5  County Clare        7          1088         1023          NA       NA
## 6   County Cork       16          2746         2629          NA        4
##   NOK_OFF ADDR_OFFMIL NOK_OFFMIL
## 1       3          17         15
## 2      NA           3          4
## 3       3          19         17
## 4       3          49         45
## 5      NA          77         69
## 6       4         185        173

This file is a series of totals collated from the Irish Army Census 1922 and the two samples of ex-British military personnel collated for this chapter. The Irish Army Census 1922 lists three types of addresses: - 1. Home Address - 2. Next of Kin Address - 3. Place of Attestation.

For the purposes of this chapter the Home Adddress and the Next of Kin Address have been summarised into a series of totals by county.

The abbreviations are as follows:

  • ADDR_TOTALMIL = Total recruits by County (Mil Census)
  • NOK_TOTALMIL = Total recruits by Next of Kin County (Mil Census)
  • ADDR_ENLIST = Enlisted sample by county
  • ADDR_OFF = Officers sample by county
  • NOK_OFF = Officers sample by Next of Kin county
  • ADDR_MIX = Mixed sample by county
  • ADDR_OFFMIL = Total officers by county (Mil Census)
  • saveNOK_OFFMIL = Total officers by Next of Kin county (Mil Census)

A all-Ireland map was created as part of the Townloads project

You can download this file from the following link. The file was reduced in size using QGIS. It is available as part of the C2.RData file under the name ire_counties

This map can be viewed using the R package ‘Tmap’.

Use the qtm command to view the map

qtm(ire_counties)

The next step is to merge the data from ‘addresses_total’ to the map file.

recruit_map <- merge(ire_counties, address_total, by.x="NAME_EN", by.y="county")

This creates a new map file called recruit_map and it now has added all the totals to the each of the thirty-two counties in Ireland in 1922.

Next, check that the merge into the new map file, ‘recruit_map’ was successful by running the following code.

head(recruit_map@data)
##           NAME_EN NAME_TAG ALT_NAME LATITUDE LONGITUDE ADDR_MIX
## 11  County Galway   Galway     <NA> 53.36274 -8.953548        5
## 26   County Sligo    Sligo     <NA> 54.15746 -8.623521        1
## 16 County Leitrim  Leitrim     <NA> 54.13998 -8.022640        1
## 22   County Meath    Meath     <NA> 53.63153 -6.731971        2
## 9   County Dublin   Dublin     <NA> 53.39225 -6.283930       38
## 5    County Clare    Clare     <NA> 52.84052 -9.042776        7
##    ADDR_TOTALMIL NOK_TOTALMIL ADDR_ENLIST ADDR_OFF NOK_OFF ADDR_OFFMIL
## 11          1328         1280          NA        2       2          66
## 26           340          337          NA        1       1          38
## 16           323          316          NA       NA      NA          24
## 22           675          657          NA        2       2          59
## 9           6988         6530          NA       22      22         426
## 5           1088         1023          NA       NA      NA          77
##    NOK_OFFMIL
## 11         65
## 26         36
## 16         24
## 22         58
## 9         416
## 5          69

Creating a subset for Ulster Province

As one of the samples of ex-servicemen utilised in this chapter is from Ulster, it was necessary to create a smaller map of Ulster from the larger recruit_map. This was created using the subset.

ulster <- subset(recruit_map, NAME_TAG %in% c("Antrim", "Armagh", "Down", "Donegal", "Fermanagh", "Cavan", "Monaghan", "Londonderry", "Tyrone"))

Use the qtm command to check that the map contains all the necessary counties for the province of Ulster

ulster %>% qtm

Inside the new map file of Ulster you will find that all the data from the original map is also present for this province.

ulster@data
##               NAME_EN    NAME_TAG     ALT_NAME LATITUDE LONGITUDE ADDR_MIX
## 23    County Monaghan    Monaghan         <NA> 54.15519 -6.923466       NA
## 10   County Fermanagh   Fermanagh         <NA> 54.35014 -7.641221       NA
## 7      County Donegal     Donegal         <NA> 54.92274 -7.905062        3
## 28      County Tyrone      Tyrone         <NA> 54.61135 -7.160032        1
## 2       County Armagh      Armagh         <NA> 54.29845 -6.551526        1
## 18 County Londonderry Londonderry County Derry 54.92932 -6.846983        2
## 8         County Down        Down         <NA> 54.36239 -5.940349       NA
## 4        County Cavan       Cavan         <NA> 53.99487 -7.352358        1
## 1       County Antrim      Antrim         <NA> 54.87024 -6.202141        5
##    ADDR_TOTALMIL NOK_TOTALMIL ADDR_ENLIST ADDR_OFF NOK_OFF ADDR_OFFMIL
## 23           480          456          NA        1       1          35
## 10           279          270          NA        1       1          13
## 7           1024         1006          NA        2       2          58
## 28           351          340          22       NA      NA           9
## 2            130          125          NA        2      NA           3
## 18           262          255          11       NA      NA           9
## 8            153          151           7       NA      NA           3
## 4            616          596          NA        3       3          49
## 1            885          854         104        3       3          17
##    NOK_OFFMIL
## 23         33
## 10         16
## 7          50
## 28          8
## 2           4
## 18          9
## 8           3
## 4          45
## 1          15

Here is an all-Ireland map of recruitment from January - November 1922

This was taken from the Irish Army Census totals using the Home Addresses given by each soldier.

tm_shape(recruit_map) + tm_fill(col = "ADDR_TOTALMIL", title = 'National Army Recruitment 1922', style = "cont", n=5) + tm_borders(col = "grey25", lty = "solid", lwd = 2) + tm_style_col_blind() + tm_text("NAME_TAG", size = "AREA", scale = 0.5)

As each soldier gave an individual address, it was possible to tabluate the county totals using a few lines of code. Many thanks to Martin Charlton of the National Centre for Geocomputation (NCG) at Maynooth University for creating this code sequence for processing the Irish Army Census data.

The code is as follows


Counties <- c("Antrim","Armagh", "Carlow", "Cavan", "Clare", "Cork", "Derry", "Donegal", "Down", "Dublin",
"Fermanagh", "Galway", "Kerry", "Kildare", "Kilkenny", "Laois", "Leitrim",
"Limerick", "Longford", "Louth", "Mayo", "Meath", "Monaghan", "Offaly", 
"Roscommon", "Sligo", "Tipperary", "Tyrone", "Waterford", "Westmeath", "Wexford",
"Wicklow")

x <- read.csv("cavan.csv", stringsAsFactors=FALSE)
head(x)
Addresses <- x$Home.Address
x$County <- ""
N <- length(Addresses)
for(i in 1:N) {
   if(Addresses[i] == "") {
      x$County[i] <- "Unknown"
   } else {
      add.split <- strsplit(Addresses[i], ",")
      n <- length(add.split[[1]])
      last.bit <- add.split[[1]][n]
      last.bit <- gsub(" ","",last.bit)
      cty <- match(last.bit,Counties)
      if(is.na(cty)) {
         x$County[i] <- "Unknown"
      } else {
         x$County[i] <- Counties[cty]
      }
   }
}

Now there is no reason to run this code section as the totals have already been created, but this was the process that created specific county totals for the twenty-six counties covered by the Irish Army Census. As the Irish Army Census was collated by the Military Archives into county segments, each was exported from the database as a csv file and was processed using the above code for the Home Address and Next of Kin Address field. The ‘unknown’ column which this code creates was then checked by hand in Apple Numbers and manual changes were applied where the county could be ascertained. i.e. Home addresses listing towns such as ‘Ennis’ were re-categorised as County Clare for the purpose of creating these totals.

Ulster Maps

This map is a distribution of the Enlisted sample of ex-servicemen in Ulster.

tm_shape(ulster) + tm_fill(col = "ADDR_ENLIST", colorNA = "grey", title = 'Enlisted Sample Recruitment', style = "cont", n=4) + tm_borders(col = "grey40", lwd = 1) + tm_style_col_blind() + tm_text("NAME_TAG", size = "AREA", scale = 0.5)

This map is a comparative map of overall recruitment in Ulster.

tm_shape(ulster) + tm_fill(col = "ADDR_TOTALMIL", colorNA = "grey", title = 'Total Ulster Province Recruitment', style = "cont", n=4) + tm_borders(col = "grey40", lwd = 1) + tm_style_col_blind() + tm_text("NAME_TAG", size = "AREA", scale = 0.5) 

Here is a comparative map combining the two earlier maps of Ulster recruitment.

tm_shape(ulster) + tm_fill(col=c("ADDR_ENLIST", "ADDR_TOTALMIL"), title = c("Enlisted Sample", "Total Ulster Recruitment"), colorNA = "grey", textNA = "No Enlistments", style = "cont") + tm_borders() + tm_style_col_blind() + tm_scale_bar() + tm_layout(panel.labels = c("Enlisted Sample - Ulster Distribution", "Total Ulster Recruitment - Irish Army Census"))

Here is a comparative map of Home Address and Next of Kin Address as listed on the Irish Army Census. It is clear that there is little to no variation between the two datasets. This shows that there was little variation between the subject and their NOK details annotated on the census.

tm_shape(recruit_map) + tm_fill(col=c("ADDR_TOTALMIL", "NOK_TOTALMIL"), title=c('Map of Home Addresses', 'Map of NOK Home Addresses'), style="cont") + tm_borders() + tm_style_col_blind() + tm_scale_bar()

This map shows the distribution of the Officers sample across the entirety of Ireland. It is quite limited due to the small number of officers that were found on the Irish Army Census.

tm_shape(recruit_map) + tm_fill(col="ADDR_OFF", title='Map of Officers Sample', style="cont", colorNA = "grey", textNA = "Not Listed") + tm_borders() + tm_style_col_blind() + tm_scale_bar()

This map is a comparative map of the Officers sample versus the distribution of the total officer corps across Ireland. The officer corps in this sample is defined as any officer with a rank higher than Sergeant.

tm_shape(recruit_map) + tm_fill(col=c("ADDR_OFF", "ADDR_OFFMIL"), title=c('Map of Officers Sample', 'Map of Mil Census Officer Corps'), style="cont", colorNA = "grey", textNA = "Not Listed") + tm_borders() + tm_style_col_blind() + tm_scale_bar()

This final map is a comparative map showing the distribution of the mixed sample versus the countrywide National Army enlistment

tm_shape(recruit_map) + tm_fill(col=c("ADDR_MIX", "ADDR_TOTALMIL"), title=c('Map of Mixed Sample', 'Map of total National Army Enlistment 1922'), style="cont", colorNA = "grey", textNA = "Not Listed") + tm_borders() + tm_style_col_blind() + tm_scale_bar()