-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssessmentPart1.Rmd
72 lines (60 loc) · 5.14 KB
/
AssessmentPart1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
title: "Assessment Part One"
author: "Sam Colchester"
date: "20/11/18"
output:
html_notebook:
fig_caption: yes
fig_height: 4
fig_width: 5
theme: flatly
html_document:
df_print: paged
theme: flatly
---
Figure 1 was built entirely using GUI based software ArcMap. This map attempts to communicate the varying visitor numbers to forestry in Powys. The other map elements intend to contextualise these figures.
Data on forestry visitors, the key metric, was difficult to track down. Given its rarity, compromises had to be made. The data is from an old survey (2004) which used a limited sample, thereby the majority of the forests on the map have missing visitor numbers. Nonetheless, it is from a reputable source (Forestry Commission) and has detailed metrics for the forests that were surveyed.
Attempts have been made to foreground the most important parts of this map by assigning darker colours to the focus land use (coniferous forestry) and making the symbolisation for forestry visitors ‘pop’ out the page with vibrant colour. Urban areas, roads and national parks, although potentially important for influencing forestry visitor counts have been given more muted colours and hues in order to recede their prominence.
Playing with colours and symbolisation is can be done fairly quickly with GUI based mapping software, click and slide. Adding multiple layers and an inset map also intuitive. However, some of the procedures that come near the start of the map making process can be fairly time consuming and processing heavy. Loading very large shapefiles (covering the entire UK) just to make a selection of them is time consuming. Selection tools also take some time to run. The same issues not present when using a programming line.
![Figure 2 - Map made with GUI (ArcMap)](Images/Powys-forestry.jpg)
```{r message=FALSE, warning=FALSE}
library(maptools)
library(RColorBrewer)
library(sp)
library(rgeos)
library(tmap)
library(tmaptools)
library(sf)
library(rgdal)
#Reading the Shapefile for the entirety of England and Wales
EngWal.OA <- read_shape("OAEngWal/Output_Area_December_2011_Generalised_Clipped_Boundaries_in_England_and_Wales.shp", as.sf = T)
#Selecting just Powys OAs with tag "W06000023"
powys.OA <- EngWal.OA[grep("^W06000023", EngWal.OA$lad11cd),]
#Import census data
carownership <- read.csv("KS404EWDATA.CSV", header = T, sep = ",")
#Joining census data
powys.OA.datamap <- append_data(powys.OA, carownership, key.shp = "oa11cd", key.data = "GeographyCode", ignore.duplicates = T)
#Simplifying the the car/van ownership column reference
own <- "KS404EW0008"
#Plotting using the car/van ownership column
MAP <- tm_shape(powys.OA.datamap) +
tm_polygons(own,
breaks = c(0, 2, 4, 6, 8, 10, Inf),
palette = "Oranges",
title = "Car ownership",
legend.format = list(fun = function(x) paste0(formatC(x, digits=0, format="f"), "%"))) +
tm_scale_bar(position = c("left", "bottom")) +
tm_layout(
title = "Car Ownership in Powys, Wales",
legend.position = c("right", "bottom"),
title.size = 1,
legend.title.size = 0.8,
legend.text.size = 0.6,
bg.color = "grey85",
inner.margins = 0.1)
```
Figure 2 was created with RStudio. This map used both open data and open software in its production and is much simpler than Figure 1. It shows how car ownership varies over space in the same study area (Powys) as above. It is loosely linked to the first map by displaying another element that may be contributing to the variation of forestry visitors in Powys.
Data wrangling, making selections and joining data are all much more effective using R because the objects being manipulated are not continually visualised (as they are in GUIs). The command line also processes these operations much faster than running the same tools in a GUI. This was particularly useful in this case because the raw data files, as retrieved online, were fairly large and it was useful to focus the scale of analysis as soon as possible.
Nonetheless, there are some disadvantages to using a command line. Many of the mapmaking procedures that occur nearer the end of the whole process are time-consuming and fiddly within a command line interface. For example, something as simple (but important) as altering a font or typeface can be carried out intuitively and quickly within a GUI. To perform the same formatting alterations in a command line the code has to be learned or searched online and this can be time consuming. However, as familiarity with R increases this is likely to be less of an issue.
Figure 2 is slightly deceptive in its presentation of the data. Most of the Output Areas (OAs) on this map actually have higher values than the range captured in the legend. Average car ownership is closer to 20% in Powys. Numerous OA values are not visible because they are clustered in urban areas and are too small to be legible. Using natural breaks (Jenks) put almost all of the large rural OAs into a single category and the map came out almost monotone. Custom (low) categories were thereby chosen to highlight variation in rural areas.
![Figure 2 - Map made with command line (R)](Images/CarownershipPowys.png)