First import the two .csv files, the first is a lookup table that shows the boundaries of the IRA brigades linked to townlands. The second file is a list of unit totals for the battalions within each of the IRA brigades outlined in the article.
# Import the lookup tables
read.csv('IRA_Lookup_1921-2_td.csv',
stringsAsFactors = F,
na.strings= c("NA", " ", "")) -> td_names
read.csv('unit_strengths.csv',
stringsAsFactors = F,
na.strings= c("NA", " ", "")) -> IRA_strengths
Import the following ESRI shapefiles: Townland boundaries, Electoral Division boundaries and an all-Ireland historical county boundaries.
# Import Electoral Divisions, Townlands and Counties
st_read('Townland_Boundaries_Generalised_20m__OSi_National_Statutory_Boundaries/Townland_Boundaries_Generalised_20m__OSi_National_Statutory_Boundaries.shp') -> td
## Reading layer `Townland_Boundaries_Generalised_20m__OSi_National_Statutory_Boundaries' from data source `/Users/jackkavanagh/Dropbox/R_Irish Geography/Townland_Boundaries_Generalised_20m__OSi_National_Statutory_Boundaries/Townland_Boundaries_Generalised_20m__OSi_National_Statutory_Boundaries.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 50109 features and 12 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -10.61854 ymin: 51.41991 xmax: -5.996385 ymax: 55.43514
## Geodetic CRS: WGS 84
st_read('Electoral_Divisions__CSO_Generalised_20M/Electoral_Divisions__CSO_Generalised_20M.shp') -> ed
## Reading layer `Electoral_Divisions__CSO_Generalised_20M' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/Electoral_Divisions__CSO_Generalised_20M/Electoral_Divisions__CSO_Generalised_20M.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 3409 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -10.66265 ymin: 51.4199 xmax: -5.996385 ymax: 55.43514
## Geodetic CRS: WGS 84
st_read('counties/counties.shp') -> cty
## Reading layer `counties' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/counties/counties.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 32 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -10.66262 ymin: 51.38887 xmax: -5.426816 ymax: 55.4353
## Geodetic CRS: WGS 84
# Import the Town shapefile
st_read('gis.osm_places_free_1/gis.osm_places_free_1.shp') -> places_dots
## Reading layer `gis.osm_places_free_1' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/gis.osm_places_free_1/gis.osm_places_free_1.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 19958 features and 5 fields
## Geometry type: POINT
## Dimension: XY
## Bounding box: xmin: -10.58114 ymin: 51.42462 xmax: -5.443358 ymax: 55.38121
## Geodetic CRS: WGS 84
# Import the three topoographical shapefiles showing Elevation, Rivers and major Lakes
st_read('Topography_Ireland/Test.shp') -> elevation_ire
## Reading layer `Test' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/Topography_Ireland/Test.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 1356 features and 9 fields
## Geometry type: LINESTRING
## Dimension: XY
## Bounding box: xmin: -10.65053 ymin: 51.42464 xmax: -5.316916 ymax: 55.8615
## Geodetic CRS: WGS 84
st_read('Topography_Ireland/Test_River.shp') -> rivers_ire
## Reading layer `Test_River' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/Topography_Ireland/Test_River.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 840 features and 12 fields
## Geometry type: LINESTRING
## Dimension: XY
## Bounding box: xmin: -10.25464 ymin: 51.54472 xmax: -5.626417 ymax: 55.39047
## Geodetic CRS: WGS 84
st_read('Topography_Ireland/Test_Lake.shp') -> lakes_ire
## Reading layer `Test_Lake' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/Topography_Ireland/Test_Lake.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 366 features and 12 fields
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: -10.18703 ymin: 51.71244 xmax: -5.612694 ymax: 55.60622
## Geodetic CRS: WGS 84
# Import physiographic units
st_read('Physiographic_Units/SHAPEFILES/PHYSIOGRAPHY_IE_LEVEL_1.shp') -> physio_ire_1
## Reading layer `PHYSIOGRAPHY_IE_LEVEL_1' from data source
## `/Users/jackkavanagh/Dropbox/R_Irish Geography/Physiographic_Units/SHAPEFILES/PHYSIOGRAPHY_IE_LEVEL_1.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 905 features and 4 fields
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: 417471.5 ymin: 519663.7 xmax: 734481.1 ymax: 965634.6
## Projected CRS: IRENET95 / Irish Transverse Mercator
# Change the CRS to WGS84
physio_ire_1 %>% st_transform(4326) -> physio_ire_1
#
physio_ire_1 %>% filter(Physioclas == "Water") -> physio_ire_1_water
nw_towns_list <- c("Arigna", "Strokestown", "Rooskey","Sligo", "Tobercurry", "Ballymote",
"Boyle", "Drumkeeran", "Dromahair", "Manorhamilton", "Bundoran",
"Ballaghaderreen", "Mohill", "Drumshanbo", "Carrick on Shannon",
"Cliffoney", "Grange")
limerick_towns_list <- c("Limerick", "Athea", "Newcastle West", "Bruree", "Croom", "Kilmallock",
"Charleville", "Bruff", "Foynes", "Abbeyfeale", "Manister", "Adare", "Doon",
"Cappamore", "Herbertstown", "Emly", "Askeaton")
places_dots %>% filter(name %in% nw_towns_list) -> nw_towns
places_dots %>% filter(name %in% limerick_towns_list) -> mw_towns
Be sure and turn off the s2 processes, the historical maps work more effectively with this process turned off.
# Switch from using S2 processes in sf
sf::sf_use_s2(FALSE)
## Spherical geometry (s2) switched off
# The following code joins the lookup table to the shapefile
IRA_TD <- td %>% mutate(TD_ID=as.integer(as.character(TD_ID))) %>% select(TD_ID) %>% left_join(td_names, by="TD_ID")
# Create specific data frames for each Brigade population table
IRA_strengths %>% filter(BRIGADE == "SLIGO NO 1") -> sligo_strengths
IRA_strengths %>% filter(BRIGADE == "NORTH SLIGO") -> north_sligo_strengths
IRA_strengths %>% filter(BRIGADE == "SOUTH SLIGO") -> south_sligo_strengths
IRA_strengths %>% filter(BRIGADE == "ARIGNA") -> arigna_strengths
IRA_strengths %>% filter(BRIGADE == "WEST LIMERICK" & YEAR == "1921") -> wlim_strengths_21
IRA_strengths %>% filter(BRIGADE == "EAST LIMERICK" & YEAR == "1921") -> elim_strengths_21
IRA_strengths %>% filter(BRIGADE == "MID LIMERICK" & YEAR == "1921") -> mlim_strengths_21
IRA_strengths %>% filter(BRIGADE == "WEST LIMERICK" & YEAR == "1922") -> wlim_strengths_22
IRA_strengths %>% filter(BRIGADE == "EAST LIMERICK" & YEAR == "1922") -> elim_strengths_22
IRA_strengths %>% filter(BRIGADE == "MID LIMERICK" & YEAR == "1922") -> mlim_strengths_22
# Creating distinct Battalion shapefiles for each IRA brigade
IRA_TD %>% select(BRIGADE_21, BATTALION_21) %>% filter(BRIGADE_21 == "SLIGO NO. 1") %>% group_by(BATTALION_21) %>% summarise() -> sligo_batts
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21, BATTALION_21) %>% filter(BRIGADE_21 == "WEST LIMERICK") %>% group_by(BATTALION_21) %>% summarise() -> wlim_batts_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21, BATTALION_21) %>% filter(BRIGADE_21 == "EAST LIMERICK") %>% group_by(BATTALION_21) %>% summarise() -> elim_batts_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21, BATTALION_21) %>% filter(BRIGADE_21 == "MID LIMERICK") %>% group_by(BATTALION_21) %>% summarise() -> mlim_batts_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "SOUTH SLIGO") %>% group_by(BATTALION_22) %>% summarise() -> south_sligo_batts
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "NORTH SLIGO") %>% group_by(BATTALION_22) %>% summarise() -> north_sligo_batts
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "ARIGNA") %>% group_by(BATTALION_22) %>% summarise() -> arigna_batts
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "WEST LIMERICK") %>% group_by(BATTALION_22) %>% summarise() -> wlim_batts_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "EAST LIMERICK") %>% group_by(BATTALION_22) %>% summarise() -> elim_batts_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22, BATTALION_22) %>% filter(BRIGADE_22 == "MID LIMERICK") %>% group_by(BATTALION_22) %>% summarise() -> mlim_batts_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
# Create specific battalion totals
wlim_strengths_21 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> wlim_strengths_batts_21
elim_strengths_21 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> elim_strengths_batts_21
mlim_strengths_21 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> mlim_strengths_batts_21
wlim_strengths_22 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> wlim_strengths_batts_22
elim_strengths_22 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> elim_strengths_batts_22
mlim_strengths_22 %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> mlim_strengths_batts_22
sligo_strengths %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> sligo_strengths_batts
north_sligo_strengths %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> north_sligo_strengths_batts
south_sligo_strengths %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> south_sligo_strengths_batts
arigna_strengths %>% select(BATTALION, BATTALION_STRENGTH) %>% distinct(.keep_all = ) -> arigna_strengths_batts
# Fix Sligo Names
sligo_strengths_batts[sligo_strengths_batts == "10th BATTALION"] <- "10th BATTALION / 1st BATTALION (SOUTH DONEGAL)"
sligo_strengths_batts[sligo_strengths_batts == "2nd BATTALION"] <- "2nd BATTALION / 1st BATTALION (SOUTH DONEGAL)"
# Create new merged shapefiles with battalion totals
wlim_batts_totals_21 <- merge(wlim_batts_21, wlim_strengths_batts_21, by.x="BATTALION_21", by.y="BATTALION")
elim_batts_totals_21 <- merge(elim_batts_21, elim_strengths_batts_21, by.x="BATTALION_21", by.y="BATTALION")
mlim_batts_totals_21 <- merge(mlim_batts_21, mlim_strengths_batts_21, by.x="BATTALION_21", by.y="BATTALION")
wlim_batts_totals_22 <- merge(wlim_batts_22, wlim_strengths_batts_22, by.x="BATTALION_22", by.y="BATTALION")
elim_batts_totals_22 <- merge(elim_batts_22, elim_strengths_batts_22, by.x="BATTALION_22", by.y="BATTALION")
mlim_batts_totals_22 <- merge(mlim_batts_22, mlim_strengths_batts_22, by.x="BATTALION_22", by.y="BATTALION")
sligo_batts_totals <- merge(sligo_batts, sligo_strengths_batts, by.x="BATTALION_21", by.y="BATTALION")
north_sligo_batts_totals <- merge(north_sligo_batts, north_sligo_strengths_batts, by.x="BATTALION_22", by.y="BATTALION")
south_sligo_batts_totals <- merge(south_sligo_batts, south_sligo_strengths_batts, by.x="BATTALION_22", by.y="BATTALION")
arigna_batts_totals <- merge(arigna_batts, arigna_strengths_batts, by.x="BATTALION_22", by.y="BATTALION")
# This creates a shapefile of the Sligo No. 1 Brigade and Limerick Brigades as they were constituted on 11 July 1921
IRA_TD %>% select(BRIGADE_21) %>% filter(BRIGADE_21 == "SLIGO NO. 1") %>% group_by(BRIGADE_21) %>% summarise() -> sligo_no1
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21) %>% filter(BRIGADE_21 == "WEST LIMERICK") %>% group_by(BRIGADE_21) %>% summarise() -> wlimerick_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21) %>% filter(BRIGADE_21 == "EAST LIMERICK") %>% group_by(BRIGADE_21) %>% summarise() -> elimerick_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21) %>% filter(BRIGADE_21 == "MID LIMERICK") %>% group_by(BRIGADE_21) %>% summarise() -> mlimerick_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_21) %>% filter(BRIGADE_21 == "EAST CLARE") %>% group_by(BRIGADE_21) %>% summarise() -> eclare_21
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
# This creates a shapefile of the Sligo and Limerick Brigades as they were constituted on 1 July 1922
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "ARIGNA") %>% group_by(BRIGADE_22) %>% summarise() -> arigna_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "NORTH SLIGO") %>% group_by(BRIGADE_22) %>% summarise() -> nsligo_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "SOUTH SLIGO") %>% group_by(BRIGADE_22) %>% summarise() -> ssligo_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "WEST LIMERICK") %>% group_by(BRIGADE_22) %>% summarise() -> wlimerick_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "EAST LIMERICK") %>% group_by(BRIGADE_22) %>% summarise() -> elimerick_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
IRA_TD %>% select(BRIGADE_22) %>% filter(BRIGADE_22 == "MID LIMERICK") %>% group_by(BRIGADE_22) %>% summarise() -> mlimerick_22
## although coordinates are longitude/latitude, st_union assumes that they are
## planar
# This creates a map of the Sligo Brigade Area in July 1921 and shows the key topography: elevation, rivers and major lakes
tm_shape(sligo_no1) + tm_fill(col = "grey") + tm_text("BRIGADE_21") +
tm_shape(cty) + tm_borders() +
tm_shape(physio_ire_1_water) + tm_fill(col = "darkblue") +
tm_shape(elevation_ire) + tm_lines(col = "brown", lwd = 0.5) +
tm_shape(rivers_ire) + tm_lines(col = "darkblue") +
tm_shape(nw_towns) + tm_dots(col = "black", size = 0.09) +
tm_text("name",
col = "black",
size = 1,
ymod = -0.3, xmod = 0,
fontfamily = "Times",
just = "top") +
tm_style("col_blind") +
tm_layout(main.title = "Topography of Sligo Brigade Area",
main.title.size = 0.9,
main.title.position = "center",
main.title.fontfamily = "Times",
frame.lwd = 0.5,
frame.double.line = TRUE,
legend.title.size = 1,
legend.title.fontfamily = "Times",
legend.text.fontfamily = "Times",
legend.position = c("0","1"),
legend.just = c("left", "top"),
bg.color = "beige") +
tm_scale_bar(text.size = 0.25,
position = c("RIGHT", "BOTTOM"))
# This creates a map of Sligo No. 1 Brigade - Battalion Areas - 11 July 1921
tm_shape(sligo_batts_totals) +
tm_polygons(col = c ("BATTALION_STRENGTH", "BATTALION_21"),
title= c ( "No. of Men", "Battalion"),
style= "cont") +
tm_shape(nw_towns) + tm_dots(col = "black", size = 0.09) +
tm_text("name",
col = "black",
size = 1,
ymod = -0.3, xmod = 0,
fontfamily = "Rockwell",
just = "top") +
tm_style("col_blind") +
tm_shape(cty) +
tm_text("NAME_EN", size = 1) +
tm_borders(lwd = 1.5) +
tm_layout(main.title = "Battalions within Sligo Brigade (11 July 1921)",
main.title.size = 0.9,
main.title.position = "center",
main.title.fontfamily = "Rockwell",
frame.lwd = 0.2,
frame.double.line = TRUE,
legend.title.size = 0.9,
legend.title.fontfamily = "Rockwell",
legend.text.fontfamily = "Rockwell",
legend.width = 0.6,
legend.position = c("0","1"),
legend.just = c("left", "top"),
bg.color = "beige",
asp = 0.8) +
tm_scale_bar(text.size = 0.5,
position = c("RIGHT", "BOTTOM"))
## Some legend labels were too wide. These labels have been resized to 0.40, 0.41. Increase legend.width (argument of tm_layout) to make the legend wider and therefore the labels larger.