Spatial Data Analysis in Ecology and Agriculture using R

Second Edition

Published by CRC Press

NOTE: This is the website for the Second Edition, with the red cover. If you have a book with a blue cover then you are working with the First Edition

The original motivation for writing this book came from my observation that researchers in precision agriculture (myself included) were spending too much time trying to tell farmers how to use the tools of spatial data analysis to manage their crops, and too little time using these tools to improve the scope and precision of their own research. Because much of spatial data is observational, the book focuses on the analysis of observational data rather than data arising from planned experiments. As a consequence, some topics normally included in a statistics book are either excluded or given short shrift. Prominent among these is ANOVA, which is only covered briefly in a later chapter. Also, while the analysis of data from planned experiments typically follows a fairly linear recipe, the analysis of observational data is often much more organic, with lots of detours and blind alleys. This can be disconcerting if you are not expecting it, and I have tried to provide a sense of this experience by including a few blind alleys and detours in the book itself.

The second edition contains R code brought up to the date of version 3.4.3 together with new material on the generalized additive model, Bayesian spatial analysis, and spatiotemporal models.

It has been announced that support for packages based on sp code, such as rgdal, will end in 2023. Although some functionality will be moved to sp, the recommendation is that users transition from sp to sf. In addition, the popular raster package is being replaced by terra. Finally, despite the existence of raster and terra, the developers of the sf package have seen fit to create their own package, called stars, that includes a raster component. In order to keep SDA2 up to date, I am releasing code in which all of the relevant spatial analysis coding is moved from sp/raster to sf/stars/terra. The code and accompanying documentation is placed in the “Keeping up with changes in R” section and the “Additional topics” section, accessible below.

Return to home page

·       Additional spatial data analysis topics


·       Preface to the second edition

·       Color images

·       Contents

·       Errata

·       Data

·       Readers' questions and author's responses

·       The CREATED and AUXILIARY data folders

·       Keeping up with changes in R

·       R Code

·       Other authors' tutorials on spatial data analysis with R