Contents // Preface (Second Edition) ... vii // Preface (First Edition) ... xi // 1 Hello World: Introducing Spatial Data... 1 // 1.1 Applied Spatial Data Analysis... 1 // 1.2 Why Do We Use R ... 2 // 1.2.1 ... In General?... 2 // 1.2.2 ... for Spatial Data Analysis?... 3 // 1.2.3 ... and for Reproducible Research?... 4 // 1.3 RandGIS... 5 // 1.3.1 What Is GIS?... 5 // 1.3.2 Service-Oriented Architectures... 6 // 1.3.3 Further Reading on GIS... 6 // 1.4 Types of Spatial Data... 8 // 1.5 Storage and Display... 10 // 1.6 Applied Spatial Data Analysis ... 11 // 1.7 R Spatial Resources... 14 // 1.8 Layout of the Book... 15 // Part I Handling Spatial Data in R // 2 Classes for Spatial Data in R ... 21 // 2.1 Introduction... 21 // 2.2 Classes and Methods in R ... 23 // 2.3 Spatial Objects... 28 // 2.4 SpatialPoints... 30 // 2.4.1 Methods... 31 // 2.4.2 Data Frames for Spatial Point Data ... 33 // xiii // XIV // Contents // 2.5 SpatialLines... 37 // 2.6 SpatialPolygons... 41 // 2.6.1 SpatialPolygonsDataFrame Objects... 44 // 2.6.2 Holes and Ring Direction... 46 // 2.7 SpatialGrid and Spati al Pixel Objects... 48 // 2.8 Raster Objects and the raster Package... 54 // 3 Visualising Spatial Data... 59 // 3.1 The Traditional Plot System... 60 // 3.1.1 Plotting Points, Lines, Polygons, and Grids... 60 // 3.1.2 Axes and Layout Elements... 61 // 3.1.3 Degrees in Axes Labels and Reference Grid... 65 // 3.1.4 Plot Size, Plotting Area, Map Scale, // and Multiple Plots ... 66 // 3.1.5 Plotting Attributes
and Map Legends... 68 // 3.2 Trellis/Lattice Plots with spplot... 69 // 3.2.1 A Straight Trellis Example... 70 // 3.2.2 Plotting Points, Lines, Polygons, and Grids... 70 // 3.2.3 Adding Reference and Layout Elements to Plots ... 73 // 3.2.4 Arranging Panel Layout... 74 // 3.3 Alternatives Routes: ggplot, latticeExtra ... 75 // 3.4 Interactive Plots ... 76 // 3.4.1 Interacting with Base Graphics... 77 // 3.4.2 Interacting with spplot and Lattice Plots... 78 // 3.5 Colour Palettes and Class Intervals... 79 // 3.5.1 Colour Palettes... 79 // 3.5.2 Class Intervals... 79 // 4 Spatial Data Import and Export... 83 // 4.1 Coordinate Reference Systems ... 84 // 4.1.1 Using the EPSG List ... 85 // 4.1.2 PROJ.4 CRS Specification... 86 // 4.1.3 Projection and Transformation... 88 // 4.1.4 Degrees, Minutes, and Seconds... 90 // 4.2 Vector File Formats... 91 // 4.2.1 Using OCR Drivers in rgdal... 92 // 4.2.2 Other Import/Export Functions... 99 // 4.3 Raster File Formats ...100 // 4.3.1 Using GDAL Drivers in rgdal...100 // 4.3.2 Other Import/Export Functions...107 // 4.4 Google Earth™, Google Maps™ and Other Formats...108 // 4.5 Geographical Resources Analysis Support System (GRASS). . 112 // 4.5.1 Broad Street Cholera Data...118 // 4.6 Other Import/Export Interfaces...122 // 4.6.1 Analysis and Visualisation Applications...122 // Contents // XV // 4.6.2 TerraLib and aRT...123 // 4.6.3 Other GIS Systems...124 // 4.7 Installing rgdal...125 // 5 Further Methods for Handling Spatial Data...127
// 5.1 Support...127 // 5.2 Handling and Combining Features...130 // 5.2.1 The rgeos Package...130 // 5.2.2 Using rgeos...132 // 5.3 Map Overlay or Spatial Join...140 // 5.3.1 Spatial Aggregation ...142 // 5.3.2 Using the raster Package for Extract Operations...145 // 5.3.3 Spatial Sampling...146 // 5.4 Auxiliary Functions...149 // 6 Spatio-Temporal Data...151 // 6.1 Introduction...151 // 6.2 Types of Spatio-Temporal Data...151 // 6.2.1 Spatial Point or Area, Time Instance or Interval..152 // 6.2.2 Are Space and Time of Primary Interest?...152 // 6.2.3 Regularity of Space-Time Layouts...152 // 6.2.4 Do Objects Change Location? ...153 // 6.3 Classes in spacetime...154 // 6.4 Handling Time Series Data with xts...155 // 6.5 Construction of ST Objects...156 // 6.6 Selection, Addition, and Replacement of Attributes...158 // 6.7 Overlay and Aggregation...159 // 6.8 Visualisation...161 // 6.8.1 Multi-panel Plots...161 // 6.8.2 Space-Time Plots ...162 // 6.8.3 Animated Plots...163 // 6.8.4 Time Series Plots ...164 // 6.9 Further Packages...164 // 6.9.1 Handling Spatio-Temporal Data...165 // 6.9.2 Analysing Spatio-Temporal Data...165 // 6.10 Outlook...165 // Part II Analysing Spatial Data // 7 Spatial Point Pattern Analysis...173 // 7.1 Introduction...173 // 7.2 Packages for the Analysis of Spatial Point Patterns...174 // 7.3 Preliminary Analysis of a Point Pattern...178 // 7.3.1 Complete Spatial Randomness...179 // 7.3.2 G Function: Distance to the Nearest Event...179 // XVI // Contents
// 7.3.3 F Function: Distance from a Point // to the Nearest Event...181 // 7.4 Statistical Analysis of Spatial Point Processes...182 // 7.4.1 Homogeneous Poisson Processes...183 // 7.4.2 Inhomogeneous Poisson Processes...184 // 7.4.3 Estimation of the Intensity...184 // 7.4.4 Likelihood of an Inhomogeneous Poisson Process...187 // 7.4.5 Second-Order Properties...190 // 7.5 Some Applications in Spatial Epidemiology...192 // 7.5.1 Case-Control Studies...193 // 7.5.2 Binary Regression Estimator...198 // 7.5.3 Binary Regression Using Generalised // Additive Models ...199 // 7.5.4 Point Source Pollution...202 // 7.5.5 Accounting for Confounding and Covariates...206 // 7.6 Further Methods for the Analysis // of Point Patterns...210 // 8 Interpolation and Geostatistics... // 8.1 Introduction... // 8.2 Exploratory Data Analysis ... // 8.3 Non-geostatistical Interpolation Methods... // 8.3.1 Inverse Distance Weighted Interpolation... // 8.3.2 Linear Regression... // 8.4 Estimating Spatial Correlation: The Variogram... // 8.4.1 Exploratory Variogram Analysis... // 8.4.2 Cutoff, Lag Width, Direction Dependence... // 8.4.3 Variogram Modelling ... // 8.4.4 Anisotropy... // 8.4.5 Multivariable Variogram Modelling... // 8.4.6 Residual Variogram Modelling... // 8.5 Spatial Prediction... // 8.5.1 Universal, Ordinary, and Simple Kriging... // 8.5.2 Multivariable Prediction: Cokriging... // 8.5.3 Collocated Cokriging ... // 8.5.4 Cokriging Contrasts... // 8.5.5 Kriging in a Local Neighbourhood...