-
Notifications
You must be signed in to change notification settings - Fork 19
/
glossary.tex
318 lines (169 loc) · 21.4 KB
/
glossary.tex
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
%line spacing?
%sudo /usr/bin/tlmgr install siunitx to install package
%or install pandoc (download) and then TinyTex in RStudio, and compile in RStudio
%alternativly can compile in Overleaf
\documentclass[a4paper,10pt]{article}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=15mm,
right=15mm,
top=15mm,
bottom=10mm,
}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{siunitx} %for degree symbol
\usepackage{multicol}
\usepackage[ddmmyyyy,hhmmss]{datetime}
\newcommand{\q}[1]{``#1''} %quotes for "top", from https://tex.stackexchange.com/questions/531/what-is-the-best-way-to-use-quotation-mark-glyphs
\setlength{\parskip}{0.5em} %gap between paragraphs
\setlength{\columnsep}{5mm} %column separation
\begin{document}
\pagenumbering{gobble} %disable page numbering, https://tex.stackexchange.com/questions/7355/how-to-suppress-page-number
\begin{center}
{\huge Glossary: Using R as a GIS}
Terms in \textit{italics} are defined in the glossary, terms with \textbf{brackets()} are R functions
\end{center}
\begin{multicols}{2}
\textbf{\#} Used to precede a comment: \texttt{\#this is a comment}
\textbf{\$} Used to refer to columns within a data frame: \texttt{dataframe\$column}
\textbf{?} shows the help file for that command \texttt{?help} or \texttt{?head}
\textbf{??} search through the help files for any reference to the word you type: \texttt{??dataframe}
\textbf{\texttt{[,]}} square brackets are used to refer to specific elements in a list or data frame. \texttt{pop2011[1,]} will show the first row and \texttt{pop2011[,1]} will show the first column
\textbf{\{\}} Used in a \texttt{for} loop or a \texttt{if} statement
\textbf{\texttt{<-}} assigns a value or output from a function to a variable
\textbf{abline()} adds vertical lines to a histogram, used to show \textit{classification} breaks: \texttt{abline(v = breaks\$brks, col = "red")}
\textbf{Acknowledgements} Information required on any map, including copyright or data sources (e.g. for OpenStreetMap or Ordnance Survey Open Data)
\textbf{aggregate()} group the specified data set by a column, applying a function to the values: \texttt{aggregate(x = LSOA\_crimes, by = list(LSOA\_crimes\$lsoa21cd), FUN = length)}
\textbf{BeiDou} Chinese version of \textit{GPS} (see also \textit{GNSS})
\textbf{BNG} (British National Grid) A \textit{projected coordinate system} used to represent locations in Great Britain, consisting of \textit{eastings} and \textit{northings}, e.g. 603125, 112589 (see also \textit{UTM} and \textit{WGS1984})
\textbf{c(,)} used to create a list, either numbers \texttt{c(1,2,3)} or \textit{strings} (text) \texttt{c("Thomas","Richard","Harriet")}
\textbf{Categorical} A variable that has a series of values with no inherent order, e.g. country names, also known as \textit{nominal} (see also \textit{variable type})
\textbf{Choropleth} A type of mapping where different colours are used to represent difference values; can use \textit{categorical} and \textit{ordinal} data
\textbf{Classes} The groups data are put into for a \textit{choropleth} map
\textbf{Classification} How data are classified into different \textit{classes} for a \textit{choropleth} map (see also \textit{jenks}, \textit{equal count}, \textit{equal interval} and \textit{standard deviation}
\textbf{classIntervals()} calculate the class invervals for the specified data: \texttt{classIntervals(var, n = 6, style = "fisher")}
\textbf{colnames()} shows the names and numbers of the columns in the specified data set: \texttt{colnames(hp.data)}
\textbf{Coordinates} The numbers representing a specific location, usually presented in pairs (see also \textit{latitude}, \textit{longitude}, \textit{WGS1984}, \textit{BNG} and \textit{UTM})
\textbf{CRS} (Coordinate Reference System) The type of coordinates that are used to represent a specific location (see also \textit{WGS1984}, \textit{BNG} and \textit{projection})
\textbf{Correlation} A measure of how much two variables are related, measured using a \textit{R\textsuperscript{2}} value
\textbf{CSV} (Comma Separated Values) A standard format of \textit{tabular data}, can be opened in Excel
\textbf{CSVT} An optional file for use with \textit{CSV} files which specifies the \textit{variable type} of each column % in the \textit{CSV} file
\textbf{Data type} How data is stored within the \textit{Attribute table}, can be \textit{integer} (whole numbers), \textit{real} (decimal numbers) and \textit{string} (text)
\textbf{DEM} (Digital Elevation Model) a \textit{raster} representation of the height of the earth's surface
\textbf{display.brewer.all()} shows all the potential colour palletts from the \texttt{RColorBrewer} library
\textbf{download.file()} download a file from the specificed URL: \texttt{download.file("http://www.nickbearman.me.uk/
data/r/sthelens.zip","sthelens.zip")}
\textbf{Eastings} A \textit{coordinate} that specifies the distance east, in meters, from the coordinates 0, 0 south-west of the Isles of Scilly (see also \textit{BNG} and \textit{northings})
\textbf{EPSG code} A 4 or 5 digit code used by GIS to define what \textit{CRS} (Coordinate Reference System) a data set is stored in, for example \textit{WGS1984} is \texttt{4326} and \textit{BNG} is \texttt{27700})
\textbf{Equal count} (Quantile) \textit{Classification} method where data are split into a number of groups by putting the same number of data items into each group, also known as \textit{quantile}, see also \textit{classification}
\textbf{Equal interval} \textit{Classification} method where data are split into \textit{classes} that are evenly distributed, e.g. 0-20\%, 20-40\%, etc., see also \textit{classification}
\textbf{F / FALSE} used to specify we don't want something, \texttt{frame = F} means we don't want a frame
\textbf{Field calculator} Used to calculate new values (e.g. differences) from existing values for all rows in a vector layer, accessed from the \textit{Attribute table}
\textbf{Fisher} \textit{Classification} method very similar to \textit{Jenks}
\textbf{for () \{\}} begins a loop to make R repeat a command a set number of times: \texttt {for (i in 1:length(mapvariables))}
\textbf{Galileo} European Union version of \textit{GPS} (see also \textit{GNSS})
\textbf{Geographic coordinate system} A coordinate system covering the whole world, usually using degrees (see also \textit{WGS1984}, \textit{latitude}, \textit{longitude})
\textbf{Geographical Information Science} (GIS) The development of the tools, software and processes used in \textit{Geographical Information Systems}
\textbf{Geographical Information Systems} (GIS) Using spatial data to answer questions about our world (see also \textit{Geographical Information Science})
\textbf{GeoJSON} Vector spatial data file, consisting of \textit{points}, \textit{lines} and \textit{polygons}; all saved in one file
\textbf{Geopackage} (GPKG) Open format for storing geospatial data, can store multiple \textit{layers} within one file, both \textit{vector} and \textit{raster}, sometimes seen as a replacement for \textit{shapefiles}
\textbf{GLONASS} Russian version of \textit{GPS} (see also \textit{GNSS})
\textbf{GNSS} (Global Navigation Satellite System) formal generic term for satellite location systems, see also \textit{GPS}, \textit{GLONASS}, \textit{Galileo} and \textit{BeiDou}
\textbf{GPS} (Global Positioning System) a series of 24 satellites in orbit around the earth which allow a GPS device to locate itself, with an accuracy of 1m to 10m (see also \textit{GNSS}, \textit{GLONASS}, \textit{Galileo} and \textit{BeiDou})
\textbf{group\_by()} used to group data by a specific value
\textbf{head()} used to show the first six rows of the data frame: \texttt{head(hp.data)}
\textbf{hist()} shows a histogram of the specified data: \texttt{hist(var)}
\textbf{if () \{\} } begins an if loop to make R choose a specific command based on a cirteria
\textbf{Inset Map} A small map included on the main map to aid orientation, e.g. a map of Ghana might include an \textit{inset map} of Africa to show where Ghana is
\textbf{install.packages()} Install (download from the internet) new \textit{libraries} in R, you only need to do this once, remember to include the quotes \texttt{install.packages("sf")}
\textbf{Integer} A whole number used to represent data, can be used in a \textit{choropleth} map (see also \textit{data type})
\textbf{Jenks} (natural breaks) \textit{Classification} method based on the Jenks algorithm which groups similar data values together, also known as \textit{natural breaks}, see also \textit{classification}
\textbf{Joining} The process of linking attribute information to spatial data, often used so the information can be shown on a \textit{choropleth} map
\textbf{Latitude} A \textit{coordinate} that specifies the distance north or south, ranging from \ang{0} at the Equator to \ang{90} (North or South) at the poles (see also \textit{WGS1984} and \textit {longitude})
\textbf{Layers} When you add data into a GIS each different file appears as a different \textit{layer}; this allows different datasets to be overlaid on one another (see also \textit{Contents})
\textbf{Layout} The term for where you create your final map, where you can add maps, \textit{legends}, \textit{scale bars}, \textit{north arrows}, etc. (also known as \textit{Print Layout}, for QGIS)
\textbf{Legend} An important part of any map, showing what the symbols or colours used on the map represent
\textbf{library()} load the specified library: \texttt{library(sf)} you need to do this everytime you start \textit{RStudio}
\textbf{Libraries} (or packages) A collection of R functions brought together to extend R's functionality, we use the \texttt{sf} and \texttt{tmap} libraries, installed with \texttt{install.packages("")} and loaded with \texttt{library()}
\textbf{Lines} Used in \textit{vector} data sets to indicate a linear feature, such as rivers, roads or railways; is a series of \textit{points} joined together in a certain order
\textbf{Longitude} A \textit{coordinate} that specifies the distance east or west, ranging from \ang{0} at the Prime Meridian (Greenwich, London, UK) to \ang{180} around the international data line (see also \textit{WGS1984} and \textit{latitude})
\textbf{MapInfo} A commercial GIS software, created by Pitney Bowes, now developed by Precisely
\textbf{mean()} calculate the mean of the specified set of values: \texttt{mean(house.prices)}
\textbf{merge()} joins two data frames together using a specified attribute or ID: \texttt{merge(LSOA, pop2021, by.x="lsoa21cd", by.y="geography.code")}
\textbf{Natural breaks} (Jenks / Fisher) \textit{Classification} method based on the \textit{Jenks} algorithm which groups similar data values together, see also \textit{classification}
\textbf{Nominal} A variable that has a series of values with no inherent order, e.g. country names, also known as \textit{categorical} (see also \textit{variable type}, \textit{ordinal} and \textit{quantitative})
\textbf{North arrow} Used to show the direction of North on a map, used to aid orientation (see also \textit{inset map})
\textbf{Northings} A coordinate that specifies the distance north, in meters, from the \textit{coordinates} 0, 0 south-west of the Isles of Scilly (see also \textit{BNG} and \textit{eastings})
\textbf{Ordinal} Similar to a categorical variable, but with a clear order, e.g. high priority, medium priority, and low priority (see also \textit{variable type}, \textit{quantitative})
\textbf{Pixel} An individual unit in a \textit{raster} data set, the size of the \textit{resolution} squared (i.e. for a 100m resolution \textit{raster} data set, each \textit{pixel} would be 100m x 100m, covering 10,000 square meters (or 1 hectare) of land)
\textbf{plot()} Base function in R used for plotting graphs and sometimes raster data
\textbf{Points} A \textit{vector} data type used to indicate a specific location, such as sample collection points, bird nest sites, towns or cities
\textbf{Polygons} A \textit{vector} data type used to indicate areas, e.g. land parcels, counties and fields; is a series of \textit{points} joined in a certain order with the last point linked back to the first point to indicate an area
\textbf{print()} Command used to output some information to the console
\textbf{Print Layout} The term for where you create your final map (see also as \textit{Layout})
\textbf{project file} A file created by GIS to store the symbology, classification, layouts and a list of the data layers you are using. Project files do not store any spatial data. Examples include .qgz / .qgs (QGIS) and .arpx (ArcGIS Pro)
\textbf{Projected coordinate system} A coordinate system covering a specific, small area, usually uses meters and can me used for measuring distances (see also \textit{BNG}, \textit{easting}, \textit{northing} and \textit{UTM})
\textbf{Projection} The way the sphere shaped earth is distorted to fit on a flat piece of paper (see also \textit{WGS1984}, \textit{BNG} and \textit{coordinate system})
\textbf{QGIS} An open source GIS free for anyone to download, use and improve
\textbf{QGIS project file} (.qgz / .qgs) (QGIS) A project file for \textit{QGIS} which contains links to all the data files (such as \textit{shapefiles} and/or \textit{GeoJSON} files) and information on how they are symbolised; the \textit{project file} does not contain the data itself
\textbf{qtm()} a quick way of showing spatial data, either just the data itself, \texttt{qtm(LSOA)} or a quick choropleth map \texttt{qtm(LSOA\_crimes\_aggregated, fill = "count of crimes")}
\textbf{Quantile} (equal count) \textit{Classification} method where data are split into a number of groups by putting the same number of data items into each group, also known as \textit{equal count}, see also \textit{classification}
\textbf{Quantitative} A numeric variable with an inherent order, e.g. GDP per capita, (see also \textit{variable type})
\textbf{R} Scripting language designed initially for statistics, expanded with \textit{libraries} to include spatial analysis, usually used through \textit{RStudio}
\textbf{R\textsuperscript{2}} The \textit{correlation} coefficient of two different data sets, a value of 1 is a strong positive \textit{correlation}, -1 is a strong negative \textit{correlation}
\textbf{Raster} A type of spatial data used with GIS, consisting of a regular grid of points spaced at a set distance (the \textit{resolution}); often used to represent heights (DEM) or temperature data (see also \textit{vector})
\textbf{Raster calculator} Used with \textit{raster} data to calculate differences (subtract) or calculate other indices (e.g. NDVI)
\textbf{read.csv()} read in a \textit{csv} file from the specified path: \texttt{read.csv("police-uk-2020-04-merseyside.csv")}
\textbf{Real} A decimal number used to represent data, can be used in a \textit{choropleth} map (see also \textit{data type})
\textbf{res()} command to display the \textit{resolution} of a \textit{raster} data set
\textbf{Resolution} The size of each \textit{pixel} in a \textit{raster} data set (e.g. 100 meters, 1km, 100km)
\textbf{RStudio} easy to use interface for \textit{R}, allows easy access to \textit{variables}, plot window and use of \textit{scripts}, known as an IDE (integrated development environment)
\textbf{Sat-nav} A navigation system in cars, which uses \textit{GPS} to direct the driver to their destination
\textbf{Scale} The ratio of units of distance on the map to units of distance in the real world; for example 1:25,000 means that 1cm on the map represents 25,000cm (or 250m) in the real world; usually shown on a \textit{scale bar}
\textbf{Scale bar} Used to show the \textit{scale} of a map
\textbf{Scripts} a series of \textit{R} commands that can be run either individually or all together at once
\textbf{setwd()} set the working directory to the specified folder: \texttt{setwd("C:/Users/nick/Documents/GIS")}
\textbf{Shapefile} A type vector of spatial data file, consisting of one of \textit{points}, \textit{lines} or \textit{polygons}; represented in \textit{GIS} as one file but in fact consisting of multiple files (between 4 and 6 files, with extensions of .shp, .shx, .dbf and .prj)
\textbf{spatial autocorrelation} A measure of how much the location of spatial data is correlated with itself, a value of 1 is a strong positive autocorrelation meaning data are spatially clustered with low values near each other and high values near each other, 0 is no spatial autocorrelation meaning data are distirbuted at random and space is not important in this data set, -1 is a strong negative correlation with low and high values as mixed as possible
\textbf{st\_as\_sf()} use to create a spatial data frame from a non spatial data frame: \texttt{st\_as\_sf(crimes, coords = c('Longitude', 'Latitude'), crs = 4326)}
\textbf{st\_join()} spatial join, joining data by location: \texttt{st\_join(LSOA, crimes\_sf\_bng)}
\textbf{st\_read()} read in a shapefile or other spatial data file: \texttt{st\_read("england\_lsoa\_2021.shp")}
\textbf{st\_transform()} reproject the specified spatial data object to the specified \textit{crs}: \texttt{st\_transform(crimes\_sf, crs = 27700)}
\textbf{st\_write()} save the specified spatial data object, e.g. as a shapefile: \texttt{st\_write(LSOA\_crimes\_aggregated, "LSOA-crime-count.shp")}
\textbf{Standard deviation} \textit{Classification} method based on standard deviation and mean of the data set
\textbf{String} A piece of text (e.g. a name) used to represent data, cannot be used to create a \textit{choropleth} map (see also \textit{data type}, \textit{real} and \textit{integer}
\textbf{Style} (QGIS) / \textbf{Symbology} (ArcGIS Pro) The options to choose the colours and/or symbols to represent data on the map; accessed through right-clicking on the layer and selecting properties and navigating to the Style tab)
\textbf{style} (R) Parameter used to specify which classification method to use for a choropleth map: \texttt{style = "equal"}
\textbf{T / TRUE} used to specify that we do want something: \texttt{legend.hist = T} means we want to show the legend histogram
\textbf{table()} count how many different values there are in the specificed column, and output as a table: \texttt{table(crimes\_sf\_bng\$Crime.type)}
\textbf{Tabular data} Data laid out in rows and columns, as used in Excel (see also \textit{CSV})
\textbf{title.position} specify the location of the title on a map: \textit{title.position = c(0.7, \q{top})}
\textbf{tm\_borders()} specify the colour and thickness of a border around a map
\textbf{tm\_compass()} specify the location of the north arrow or compass on a map: \texttt{tm\_compass(position = c(0.3, 0.07))}
\textbf{tm\_dots()} specify the symbology of a point layer on a map: \texttt{tm\_dots(size = 0.1, shape = 19, col = "darkred", alpha = 0.5)}
\textbf{tm\_layout()} specify a range of options in the map layout: \texttt{tm\_layout(frame = F, title = "Liverpool", title.size = 2)}
\textbf{tm\_lines()} specify the symbology and options of a line layer on a map: \texttt{tm\_lines(col = "black")}
\textbf{tm\_polygons()} specify the symbology and options of a polygon layer on a map: \texttt{tm\_polygons("Age00to04", title = "Aged 0 to 4", palette = "Greens", n = 6, style = "jenks")}
\textbf{tm\_raster()} specify and plot a raster data set: \texttt{tm\_raster(palette = "Greens")}
\textbf{tm\_scale\_bar()} specify the location and style of the scale bar on a map \texttt{tm\_scale\_bar(width = 0.22, position = c(0.05, 0.18))}
\textbf{tm\_shape()} specify the layer shown on a map, often used in conjunction with \textit{tm\_polygons()}: \texttt{tm\_shape(LSOA)}
\textbf{tmap\_mode()} change the tmap mode from plot (default) to view (slippy map with basemap) or back: \texttt{tmap\_mode("view"), tmap\_mode("plot")}
\textbf{tmap\_save()} save the map to a specified output file: \texttt{tmap\_save(m, filename = paste0("map-",mapvariables[i],".png"))}
\textbf{unzip()} unzip a file: \texttt{unzip("sthelens.zip")}
\textbf{UTM} (Universal Transverse Mercator) A type of \textit{projected coordinate system} used to represent any location in the world, consisting of a series of zones and a set of \textit{coordinates} for each zone, in meters (see also \textit{BNG} and \textit{WGS1984})
\textbf{Variable type} Information on the type of information within a variable, can be \textit{categorical}, \textit{ordinal} or \textit{nominal}
\textbf{Vector} A type of spatial data used with \textit{GIS}, consisting of \textit{points}, \textit{lines} and \textit{polygons} (see also \textit{raster})
\textbf{Vertex (vertices)} Name for each of the points that connect the \textit{line} segments of a \textit{line} or \textit{polygon} \textit{shapefile}
\textbf{View()} view the specified data in a new tab in RStudio: \texttt{View(hp.data)}
\textbf{WGS1984} A \textit{coordinate system} used to represent any location in the world, consisting of \textit{latitude} and \textit{longitude} e.g. 51.0426 N, 1.3772 E or \ang{51} 2’ 33.53’’ N, \ang{1} 22’ 38.23’’ E (see also \textit{BNG} and \textit{UTM})
\textbf{which()} function to select which elements or rows match the specified criteria: \texttt{which(tram\_stations\$RSTNAM == "Chorlton")}
\end{multicols}
\begin{center}
{\footnotesize \textit{This glossary was last updated on {\today} by Dr. Nick Bearman ([email protected]) and is written in LaTeX. This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License, http://creativecommons.org/ licenses/by-sa/4.0/deed.en. The latest version of the PDF is at https://github.com/nickbearman/intro-r-spatial-analysis.}}
\end{center}
\end{document}