forked from mpeeples2008/ArchNetSci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lookup.Rmd
273 lines (228 loc) · 10.5 KB
/
lookup.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
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
# (PART) Additional Material{-}
# Table of Contents Quick Reference{- #TableOfContents}
The purpose of this section is to provide a quick index of topics covered in this document so that you can easily identify and work on specific things. Use the cross-reference links below to find what you are looking for.
## Welcome{-}
[Welcome](#Welcome)
* [How Should I Use this Online Companion?](#HowTo)
* [Reproducibility](#Repro)
* [Computational Archaeology Discord Community](#Discord)
* [New to R and R Studio?](#NewToR)
* [Contribute to the Project](#Contributing)
* [Help Build the Community](#Community)
* [Acknowledgements](#Acknowledgements)
## PART II: GETTING STARTED{-}
## Section 1: Getting Started with R{-}
[Getting Started with R](#GettingStarted)
* [Download and Install R](#InstallR)
+ [Windows](#Windows)
+ [MacOC](#MacOS)
+ [Linux](#Linux)
* [Download and Install R-Studio](#InstallRStudio)
* [Run R-Studio](#RunRStudio)
* [R and R-Studio Basics](#RBasics)
+ [Organization of R-Studio](#Org)
+ [Mathematical Operations](#Math)
+ [Creating Variables/Objects](#Variables)
+ [Logical Operators](#Logical)
+ [Vectors](#Vectors)
+ [Using Basic R Functions](#Functions)
+ [Tabular Data](#Tabular)
+ [Data Types in R](#DataTypes)
+ [Object Types in R](#ObjectTypes)
- [Vectors](#Vec)
- [Matrices](#Mat)
- [Data Frames](#DF)
- [Lists](#List)
* [The Workspace Tab](#WorkspaceTab)
+ [Setting the Working Directory](#Directory)
+ [Working with your first R script](#FirstScript)
* [Installing and Using Packages](#InstallPackages)
* [Working with External Files](#WorkingWithFiles)
* [Plotting Data](#Plotting)
* [Warnings and Messages in R](#Warnings)
* [More Advanced R Features](#AdvancedR)
+ [Conditional Statements](#Conditionsls)
+ [Loops](#Loops)
+ [Custom Functions](#CustomFunctions)
* [Test Your Skills](#TestYourSkills)
## PART II: WORK WHILE YOU READ{-}
## Section 2: Data and Workspace Setup{-}
[Data and Workspace Setup](#DataAndWorkspace)
* [Data Sets](#DataSets)
+ [Just Give Me Everything](#Everything)
+ [Roman Road Networks](#RomanRoads)
+ [Southwest Social Networks Project Ceramic Similarity Networks](#SWSN)
+ [Cibola Region Technological Similarity Networks](#Cibola)
+ [Himalayan Visibility Networks](#Himalaya)
+ [Archaeological Publication Networks](#ArchPubs)
+ [Iron Age Sites in Southern Spain](#Guadalquivir)
* [Importing Data in R](#Importing)
* [Required/Suggested R Packages](#PrimaryPackages)
+ [Should I Just Install Everything](#ShouldIInstall)
* [R Environment](#Environment)
* [Suggested Workspace Setup](#WorkspaceSetup)
## Section 3: Network Data in R{-}
[Network Data in R](#NetworkData)
* [Network Data Formats](#NetworkDataFormats)
+ [Edge list](#Edgelist)
+ [Adjacency list](#AdjacencyList)
+ [Adjacency matrix](#AdjacencyMatrix)
+ [Incidence matrix](#IncidenceMatrix)
+ [Node and edge attribute data](#NodeAttributes)
* [Network Types](#TypesOfNetworks)
+ [Simple networks](#SimpleNetworks)
+ [Directed networks](#Directed Networks)
+ [Signed, Categorized, and Weighted Networks](#WeightedNetworks)
+ [Two-mode networks](#TwoMode)
+ [Similarity networks](#SimilarityNetworks)
- [Brainerd-Robinson similarity](#BrainerdRobinson)
- [Morisita's Index](#Morisita)
- [$\chi^{2}$ Distance](#ChiSquare)
- [Jaccard Similarity](#Jaccard)
- [Creating network objects from similarity matrices](#NetFromSim)
+ [Ego networks](#EgoNetworks)
+ [Multilayer networks](#Multinet)
* [Converting among network object types](#ConvertingNetworkFormats)
## Section 4: Exploratory Network Analysis{-}
[Exploratory Network Analysis](#Exploratory)
* [Example Network Objects](#ExampleNetworkObjects)
* [Calculating Network Metrics in R](#CalcMetric)
* [Network Centrality](#Centrality)
+ [Degree Centrality](#Degree)
+ [Betweenness Centrality](#Betweenness)
+ [Eigenvector Centraoity](#Eigenvector)
+ [Page Rank](#PageRank)
+ [Closeness Centrality](#Closeness)
+ [Hubs and Authorities](#HubsAndAuthorities)
* [Triads and Clustering](#TriadsAndClustering)
+ [Triads](#Triads)
+ [Triad Census](#Triads)
+ [Transitivity](#Transitivity)
* [Walks, Paths, and Distance](#WalksPathsDistance)
+ [Distance](#Distance)
+ [Shortest Paths](#ShortestPaths)
+ [Network Diameter](#Diameter)
* [Components and Bridges](#ComponentsAndBridges)
+ [Identifying Components](#IdentifyingComponents)
+ [Cutpoints](#Cutpoints)
+ [Bridges](#Bridges)
* [Cliques and Communities](#CliquesAndCommunities)
+ [Cliques](#Cliques)
+ [K-Cores](#KCores)
+ [Cluster Detection Agloritms](#ClusterDetection)
- [Girvan-Newman Clustering](#GirvanNewman)
- [Walktrap Algorithm](#Walktrap)
- [Louvain Modularity](#Louvain)
- [Calculating Modularity of Partitions](#Modularity)
- [Finding Edges Between Communities](#FindingEdgesBetween)
* [Case Study: Roman Roads in the Iberian Peninsula](#ExploratoryRomanRoads)
## Section 5: Quantifying Uncertainty{-}
[Quantifying Uncertainty](#Uncertainty)
* [R Scripts for Conducting Uncertainty Analysis](#UncertaintyScripts)
* [A General Approach to Uncertainty](#UncertaintyGeneral)
* [Nodes Missing at Random](#NodesAtRandom)
* [Edges Missing at Random](#EdgesAtRandom)
* [Assessing Individual Nodes/Edges Missing at Random](#IndNodesAtRandom)
* [Nodes/Edges Missing Due To Biased Sampling](#MissingBiased)
* [Resampling with Incidence Matrices](#SimIncidence)
* [Edge Probability Modeling](#EdgeProbability)
+ [Edge Probability and Similarity Networks](#EdgeProbSim)
* [Uncertainty Due to Small or Variable Sample Sizes](#SampleSize)
## Section 6: Network Visualization{-}
[Network Visualization](#NetworkVisualization)
* [Data and R Setup](#VizDatasets)
* [Visualizing Networks in R](#VisInR)
+ [`network` package](#networkpackage)
+ [`igraph` package](#igraphpackage)
+ [`ggraph` package](#ggraphpackage)
* [Network Visualization Options](#NetVizOptions)
+ [Graph Layouts](#GraphLayouts)
- [Manual Layouts](#ManualLayouts)
- [Geographic Layouts](#GeographicLayouts)
- [Shape-based and Algorithmic Layouts](#AlgorithmicLayouts)
+ [Node and Edge Options](#NodeEdgeOptions)
- [Nodes](#NodeOptions)
- [Edges](#EdgeOptions)
- [Labels](#LabelOptions)
+ [Be Kind To the Color Blind](#Colorblind)
+ [Communities and Groups](#ViZCommunities)
* [Replicating the Book Figures](#ReplicatingBookFigures)
+ [Figure 6.1 - Manual Layout](#Figure_6_1)
+ [Figure 6.2 - Examples of Common Network Plot Formats](#Figure_6_2)
+ [Figure 6.3 - Examples of Rare Network Plot Formats](#Figure_6_3)
+ [Figure 6.4 - Simple Network with Clusters](#Figure_6_4)
+ [Figure 6.5 - Interactive Layout](#Figure_6_5)
+ [Figure 6.6 - Absolute Geographic Layout](#Figure_6_6)
+ [Figure 6.7 - Distorted Geographic Layout](#Figure_6_7)
+ [Figure 6.8 - Graph Layout Algorithms](#Figure_6_8)
+ [Figure 6.9 - Heirarchical Graph Layouts](#Figure_6_9)
+ [Figure 6.10 - Be Kind To the Color Blind](#Figure_6_10)
+ [Figure 6.11 - Node Symbol and Color Schemes](#Figure_6_11)
+ [Figure 6.12 - Image for Node, Example 1](#Figure_6_12)
+ [Figure 6.13 - Image for Node, Example 2](#Figure_6_13)
+ [Figure 6.14 - Edge Thickness and Color](#Figure_6_14)
+ [Figure 6.15 - Edge Direction](#Figure_6_15)
+ [Figure 6.16 - Edge Binarization](#Figure_6_16)
+ [Figure 6.17 - Edge Bundling](#Figure_6_17)
+ [Figure 6.18 - Group-in-a-box Layout](#Figure_6_18)
+ [Figure 6.19 - Weighted Adjacency Matrix](#Figure_6_19)
+ [Figure 6.20 - Nodetrix Diagram Interactive Plot](#Figure_6_20)
+ [Figure 6.21 - Temporal Change, The Filmstrip Approach](#Figure_6_21)
+ [Figure 6.22 - Temporal Change, Similtaneous Display](#Figure_6_22)
+ [Figure 6.23 - Timelines and Time Prisms](#Figure_6_23)
+ [Figure 6.24 - Animation](#Figure_6_24)
+ [Figure 6.25 - Interactive Networks](#Figure_6_25)
+ [Figure 6.26 - Case Study, SWSN Example 1](#Figure_6_26)
+ [Figure 6.27 - Case Study, SWSN Example 2](#Figure_6_27)
## Section 7: Spatial Networks{-}
[Spatial Networks](#SpatialNetworks)
* [Working with Geographic Data in R](#GeoData)
* [Example Data](#ExampleData)
* [Planar Networks and Trees](#PlanarTrees)
+ [Evaluating Planarity](#EvaluatingPlanarity)
+ [Defining Trees](#DefiningTress)
* [Spatial Network Models](#SpatialNetworkModels)
+ [Relative Neighborhood Networks](#RelativeNeighborhoods)
+ [Gabrial Graphs](#GabrialGraphs)
+ [Beta Skeletons](#BetaSkeletons)
+ [Minimum Spanning Trees](#MinSpanningTrees)
+ [Delaunay Triangulation](#DelaunayTri)
+ [K-Nearest Neighbors](#KNN)
+ [Max Distance Networks](#MaxDist)
* [Case Studies: Spatial Networks and Networks in Space](#SpaceCaseStudies)
+ [Proximity of Iron Age Sites in Southern Spain](#IronAgeSpain)
+ [Networks in Space in the U.S. Southwest](#SpaceSW)
## PART III: GOING BEYOND THE BOOK{-}
## Section 8: Exponential Random Graph Models{-}
[Exponential Random Graph Models](#ERGM)
* [ERGMs in R](#ERGMsInR)
* [Cranborne Chase Visibility Network Example](#CranborneChase)
+ [Assessments of Network Properties](#NetProperties)
+ [Fitting Models with `ergm`](#FitModels)
+ [Building a Model Based on Theory](#ModelTheory)
+ [Assessing Goodness-of-Fit](#GOF)
+ [Asessing Models and MCMC Diagnostics](#Diagnostics)
* [Simulating Networks from ERGMs](#SimERGMs)
* [Additinoal Info on ERGM Terms](#ERGMterms)
+ [Avoiding Model Degeneracy](#Degeneracy)
## Section 9: Spatial Interaction Models{-}
[Spatial Interaction Models](#SpatialInteraction)
* [Simple Gravity Models](#GravityModel)
+ [Parameterizing the Gravity Model](#ParameterizingGravity)
* [The Rihll and Wilson "Retail" Model](#RihllWilson)
+ [Parameterizing the Retail Model](#ParameterizingRetail)
* [Truncated Power Functions](#TruncatedPower)
* [Other Spatial Interaction Models](#OtherModels)
## Section 10: Affiliation Data and Co-Association{-}
[Affiliation Data and Co-Association](#Affiliation)
* [Analyzing Two-Mode Networks](#AnalyzingTwoMode)
+ [Using Traditional Network Metrics](#TraditionalMetrics)
+ [Using Two-Mode Specific Network Metrics](#TwoModeMetrics)
+ [Projecting Two-Mode Networks Before Analysis](#ProjectingTwoMode)
* [Correspondence Analysis](#CorrespondenceAnalysis)
+ [Network Visuals Using Correspondence Analysis](#CAViz)
* [Measuring Co-Association](#MeasuringCoassociation)
+ [Alternative Methods for Visualizing Co-associations](#COViz)
## ADDITIONAL INFORMATION AND MATERIALS{-}
[References and R Packages](https://book.archnetworks.net/references-and-r-packages.html)
[ArchNetSci GitHub Repository](https://github.com/mpeeples2008/ArchNetSci)