ebook img

Geographic Data Science with R: Visualizing and Analyzing Environmental Change PDF

310 Pages·2023·45.923 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Geographic Data Science with R: Visualizing and Analyzing Environmental Change

Geographic Data Science with R The burgeoning field of data science has provided a wealth of techniques for analysing large and complex geospatial datasets, including descriptive, explanatory, and predictive analytics. How- ever, applying these methods is just one part of the overall process of geographic data science. Other critical steps include screening for suspect data values, handling missing data, harmoniz- ing data from multiple sources, summarizing the data, and visualizing data and analysis results. Although there are many books available on statistical and machine learning methods, few en- compass the broader topic of scientific workflows for geospatial data processing and analysis. The purpose of Geographic Data Science with R is to fill this gap by providing a series of tutorials aimed at teaching good practices for using geospatial data to address problems in environmental geography. It is based on the R language and environment, which currently provides the best option for working with diverse spatial and non-spatial data in a single platform. Fundamental techniques for processing and visualizing tabular, vector, and raster data are introduced through a series of practical examples followed by case studies that combine multiple types of data to ad- dress more complex problems. The book will have a broad audience. Both students and professionals can use it as a workbook to learn high-level techniques for geospatial data processing and analysis with R. It is also suit- able as a textbook. Although not intended to provide a comprehensive introduction to R, it is designed to be accessible to readers who have at least some knowledge of coding but little to no experience with R. Key Features: • Focus on developing practical workflows for processing and integrating multiple sources of geospatial data in R • Example-based approach that teaches R programming and data science concepts through real-world applications related to climate, land cover and land use, and natural hazards. • Consistent use of tidyverse packages for tabular data manipulation and visualization. • Strong focus on analysing continuous and categorical raster datasets using the new terra package • Organized so that each chapter builds on the topics and techniques covered in the preceding chapters • Can be used for self-study or as the textbook for a geospatial science course. CHAPMAN & HALL/CRC DATA SCIENCE SERIES Reflecting the interdisciplinary nature of the field, this book series brings together researchers, practi- tioners, and instructors from statistics, computer science, machine learning, and analytics. The series will publish cutting-edge research, industry applications, and textbooks in data science. The inclusion of concrete examples, applications, and methods is highly encouraged. The scope of the series includes titles in the areas of machine learning, pattern recognition, predictive analytics, business analytics, Big Data, visualization, programming, software, learning analytics, data wrangling, interactive graphics, and reproducible research. Published Titles Statistical Foundations of Data Science Jianqing Fan, Runze Li, Cun-Hui Zhang, and Hui Zou A Tour of Data Science: Learn R and Python in Parallel Nailong Zhang Explanatory Model Analysis Explore, Explain, and, Examine Predictive Models Przemyslaw Biecek, Tomasz Burzykowski An Introduction to IoT Analytics Harry G. Perros Data Analytics A Small Data Approach Shuai Huang and Houtao Deng Public Policy Analytics Code and Context for Data Science in Government Ken Steif Supervised Machine Learning for Text Analysis in R Emil Hvitfeldt and Julia Silge Massive Graph Analytics Edited by David Bader Data Science An Introduction Tiffany-Anne Timbers, Trevor Campbell and Melissa Lee Tree-Based Methods A Practical Introduction with Applications in R Brandon M. Greenwell Urban Informatics Using Big Data to Understand and Serve Communities Daniel T. O’Brien Introduction to Environmental Data Science Jerry Douglas Davis Hands-On Data Science for Librarians Sarah Lin and Dorris Scott For more information about this series, please visit: https://www.routledge.com/Chapman--Hall- CRC-Data-Science-Series/book-series/CHDSS Geographic Data Science with R Visualizing and Analyzing Environmental Change Michael C. Wimberly Designed cover image: © Michael C. Wimberly First edition published 2023 by CRC Press 6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742 and by CRC Press 4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN CRC Press is an imprint of Taylor & Francis Group, LLC © 2023 Michael C. Wimberly Reasonable efforts have been made to publish reliable data and information, but the author and pub- lisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information stor- age or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact [email protected] Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for identification and explanation without intent to infringe. ISBN: 978-1-032-34771-4 (hbk) ISBN: 978-1-032-35288-6 (pbk) ISBN: 978-1-003-32619-9 (ebk) DOI: 10.1201/9781003326199 Typeset in Latin modern by KnowledgeWorks Global Ltd. Publisher’s note: This book has been prepared from camera-ready copy provided by the authors. Access the companion website: insert CW URL To my parents, who taught me to value learning and supported my academic endeavors Contents List of Figures xi List of Tables xvii Preface xix About the Author xxv 1 Introduction to R 1 1.1 Basic Calculations . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 R Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.2 Matrices and lists. . . . . . . . . . . . . . . . . . . . . . 9 1.2.3 Data frames . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3 R Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.3.1 Data input and graphics . . . . . . . . . . . . . . . . . . 14 1.3.2 Statistical analysis . . . . . . . . . . . . . . . . . . . . . 19 1.4 Tips for Programming in R . . . . . . . . . . . . . . . . . . . . 22 1.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2 Graphics with ggplot2 25 2.1 Creating a Simple Plot . . . . . . . . . . . . . . . . . . . . . . . 27 2.2 Aesthetic Mappings. . . . . . . . . . . . . . . . . . . . . . . . . 29 2.3 Facets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.4 Geometric Objects . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.5 Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.6 Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.7 Combining ggplot Functions . . . . . . . . . . . . . . . . . . . . 43 2.8 Other Types of Plots . . . . . . . . . . . . . . . . . . . . . . . . 44 2.8.1 Scatterplots . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.8.2 Bar charts . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.8.3 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.8.4 Boxplots . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.9 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 vii viii Contents 3 Processing Tabular Data 49 3.1 Single Table Verbs . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.1.1 Select and rename . . . . . . . . . . . . . . . . . . . . . 50 3.1.2 The pipe operator . . . . . . . . . . . . . . . . . . . . . 53 3.1.3 Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.1.4 Arrange . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3.1.5 Mutate and transmute . . . . . . . . . . . . . . . . . . . 56 3.1.6 Application . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.2 Summarizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3.2.1 Counts. . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.2.2 Summary functions. . . . . . . . . . . . . . . . . . . . . 64 3.3 Pivoting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 3.4 Joining Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4 Dates in R 73 4.1 Converting Characters to Dates . . . . . . . . . . . . . . . . . . 73 4.2 Other lubridate Operators and Functions . . . . . . . . . . . . 79 4.3 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5 Vector Geospatial Data 83 5.1 Importing Geospatial Data . . . . . . . . . . . . . . . . . . . . 84 5.2 Creating Simple Maps . . . . . . . . . . . . . . . . . . . . . . . 85 5.3 Overlaying Vector Datasets . . . . . . . . . . . . . . . . . . . . 89 5.4 Choropleth Maps . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.5 Modifying the Appearance of the Map . . . . . . . . . . . . . . 94 5.6 Exporting Graphics Output . . . . . . . . . . . . . . . . . . . . 98 5.7 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 6 Raster Geospatial Data—Continuous 103 6.1 Importing Raster Data . . . . . . . . . . . . . . . . . . . . . . . 104 6.2 Maps of Raster Data . . . . . . . . . . . . . . . . . . . . . . . . 107 6.3 Multilayer Rasters . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.4 Computations on Raster Objects . . . . . . . . . . . . . . . . . 116 6.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 7 Raster Geospatial Data—Discrete 123 7.1 Importing and Mapping Land Cover Data . . . . . . . . . . . . 124 7.2 Reclassifying Raster Data . . . . . . . . . . . . . . . . . . . . . 128 7.3 Focal Analysis of Raster Data . . . . . . . . . . . . . . . . . . . 133 7.4 Land Cover Change Analysis . . . . . . . . . . . . . . . . . . . 135 7.5 Land Cover Transition Matrices . . . . . . . . . . . . . . . . . . 141 7.6 Mapping Specific Land Cover Changes . . . . . . . . . . . . . . 147 7.7 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Contents ix 8 Coordinate Reference Systems 151 8.1 Reprojecting Vector Data . . . . . . . . . . . . . . . . . . . . . 152 8.2 Reprojecting Raster Data . . . . . . . . . . . . . . . . . . . . . 160 8.3 Specifying Coordinate Reference Systems . . . . . . . . . . . . 167 8.4 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 9 Combining Vector Data with Continuous Raster Data 171 9.1 Accessing Data with R Packages . . . . . . . . . . . . . . . . . 171 9.2 Zonal Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 9.3 Zone Size and Raster Cell Size . . . . . . . . . . . . . . . . . . 176 9.4 Extracting Raster Values with Point Data . . . . . . . . . . . . 183 9.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 10 Combining Vector Data with Discrete Raster Data 189 10.1 Visualizing and Manipulating Vector Data . . . . . . . . . . . . 191 10.2 Zonal Summaries of Discrete Raster Data . . . . . . . . . . . . 196 10.3 Summarizing Land Cover With Stream Buffers . . . . . . . . . 203 10.4 Summarizing Land Cover With Point Buffers . . . . . . . . . . 210 10.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 11 Application—Wildfire Severity Analysis 215 11.1 Remote Sensing Image Analysis . . . . . . . . . . . . . . . . . . 216 11.2 Burn Severity Classification . . . . . . . . . . . . . . . . . . . . 221 11.3 The Wildland-Urban Interface. . . . . . . . . . . . . . . . . . . 223 11.4 Topographic Effects . . . . . . . . . . . . . . . . . . . . . . . . 229 11.4.1 Data processing. . . . . . . . . . . . . . . . . . . . . . . 230 11.4.2 Generalized additive modeling . . . . . . . . . . . . . . 234 11.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 12 Application—Species Distribution Modeling 241 12.1 Tree Species Data. . . . . . . . . . . . . . . . . . . . . . . . . . 242 12.2 WorldClim Historical Climate Data . . . . . . . . . . . . . . . . 247 12.3 Modeling the Climate Niche . . . . . . . . . . . . . . . . . . . . 251 12.3.1 Subalpine fir . . . . . . . . . . . . . . . . . . . . . . . . 251 12.3.2 Douglas-fir . . . . . . . . . . . . . . . . . . . . . . . . . 255 12.4 Accuracy Assessment . . . . . . . . . . . . . . . . . . . . . . . . 259 12.5 Climate Change Projections . . . . . . . . . . . . . . . . . . . . 263 12.6 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Appendix 269 Bibliography 277 Index 281

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.