<style> .pull-left-50 { float: left; width: 50%; } .pull-right-50 { float: right; width: 50%; } .pull-left-60 { float: left; width: 60%; } .pull-right-40 { float: right; width: 40%; } .pull-right-40-padding { float: right; width: 38%; padding-left: 10px } </style> <style> .pull-left-70 { float: left; width: 70%; } .pull-right-30 { float: right; width: 30%; } </style> <div class = "content"> <br> <center> <div style = 'margin-top: -80px; margin-bottom: -80px; margin-left:-30px; margin-right:-30px;'> <p class="text-center" style = 'font-size: 74px; line-height:1.5; font-weight:bold;'>Spatial Data Science</p> <!-- <p class="text-center" style = 'font-size: 56px; line-height:1.5; font-weight:bold;'>R for spatial data analysis and visualization</p> <p class="text-center" style = 'font-size: 48px; line-height:1.5; font-weight:bold;'>How geostatistics can help with decision-making in global health</p> <p class="text-center" style = 'font-size: 38px; font-weight:bold; margin-top:-40px;'>Case studies in tropical disease mapping</p><br> --> </div> </center> <br> <table style="margin:0px; margin-left:-10px; border-top:0; border-bottom:0;"> <tr> <td style="width: 440px;"> <div style = 'padding: 40px; padding-left: 40px; font-size: 32px; font-weight:bold; margin-top: 10px; margin-bottom: -50px;'> <br> Paula Moraga, Ph.D.<br> </div> <div style = 'padding: 40px; padding-left: 40px; font-size: 28px; margin-bottom: -60px;'> Asst. Professor of Statistics </div> <div style = 'padding: 40px; padding-left: 40px; font-size: 28px; margin-bottom: -55px;'> King Abdullah University of Science and Technology (KAUST), Saudi Arabia </div> <div style = 'padding: 40px; padding-left: 40px; font-size: 26px; line-height:1.5;margin-bottom: 40px;'> <a href='http://twitter.com/Paula_Moraga_' target='_blank'> <i class='fa fa-twitter fa-fw'></i> @Paula_Moraga_</a><br> <a href='https://Paula-Moraga.github.io/' target='_blank'> <i class='fa fa-globe fa-fw'></i> www.PaulaMoraga.com</a><br> <!-- <a href='http://bit.ly/prestdm' target='_blank'><i class='fa fa-link fa-fw'></i> www.paulamoraga.com/presentation-geohealth/</a><br> --> </div> </td> <td> <center> <img src="./figures/logogeohealth.png" height = "200" alt = "a png"><br><br> <img src="./figures/Statistics at KAUST_Logo for digital use_small.png" height = "160" alt = "a png"> </center> </td> </tr> </table> </div> <!-- #--- <div style="margin-top:-20px"></div> # Who am I? <div style="margin-top:-20px"></div> <style type="text/css"> .circular--square { border-radius: 50%; } </style> <table style="margin:20px; border-top:0; border-bottom:0; margin-bottom: -20px;"> <tr> <td> <p style="font-size:25px"><b>Paula Moraga, Ph.D.</b></p> Assistant Professor of Statistics <br>for Public Health at KAUST<br><br> PI Geospatial Statistics and Health Surveillance Research Group<br><br> <img src="./figures/Statistics at KAUST_Logo for digital use_small.png" height = "120" alt = "a png"> <img src="./figures/logogeohealth.png" height = "120" alt = "a png"> </td> <td style="width:40%"> <img class = "circular--square" src="./figures/paula.png" width = "200" alt = "a png"><br><br> <a href='http://twitter.com/Paula_Moraga_' target='_blank'><i class='fa fa-twitter fa-fw'></i> @Paula_Moraga_</a><br> <a href='https://Paula-Moraga.github.io/' target='_blank'><i class='fa fa-globe fa-fw'></i> www.PaulaMoraga.com</a><br> </td> </tr> </table> <br> <i class='fa fa-map-marked-alt fa-fw'></i> Geospatial data analysis, statistical modeling<br> <i class='fa fa-hospital fa-fw'></i> Spatial epidemiology, disease mapping, health surveillance<br> <i class='fa fa-laptop fa-fw'></i> Development of R packages and interactive visualization applications<br> <i class='fa fa-book fa-fw'></i> Author book Geospatial Health Data http://bit.ly/bookgeo<br> <i class='fa fa-graduation-cap fa-fw'></i> PhD Mathematics, Valencia. Master's Biostatistics, Harvard<br> --> --- background-image: url(./figures/overview.png) background-size: contain --- <div style="margin-top:-20px"></div> ## Book <div style="margin-top:-10px"></div> Geospatial Health Data: Modeling and Visualization with R-INLA and Shiny (2019, Chapman & Hall/ CRC Press) http://www.paulamoraga.com/book-geospatial/ .pull-left[ <div style="margin-top:-20px"></div> - Manipulate and transform point, areal and raster data,<br> and create maps with R - Fit and interpret Bayesian spatial and spatio-temporal models with INLA and SPDE - Interactive visualizations, reproducible reports, dashboards, and Shiny apps - Model disease risk and quantify risk factors in different settings - Health examples but methods useful to analyze georeferenced data in other fields such as ecology or criminology ] .pull-right[ <center> <img src="./figures/bookcover.jpg" style="margin-top:-5px; margin-left:-10px; width:85%;"/> </center> ] --- # Spatial Data Science with R Spatial data arise in many fields including health, ecology, environment and business. In this course, we will learn statistical methods, modeling approaches, and visualization techniques to analyze spatial data using R. We will also learn how to create interactive dashboards that facilitate the communication to collaborators and policymakers. <img src="figures/bookghd.png" width="70%" style="display: block; margin: auto;" /> --- # Course schedule Monday March 6 - Introduction to R - Types of spatial data - Making maps with R Tuesday March 7 - Areal data modeling - Open spatial data Wednesday March 8 - Interactive visualizations and dashboards to communicate results - R Markdown and flexdashboard --- # R and RStudio Participants should bring their laptops with [R](https://cran.rstudio.com) and [RStudio](https://www.rstudio.com/products/rstudio/download) installed. They should also install the following R packages: ```r install.packages(c("sf", "sp", "spdep", "raster", "rgdal", "rgeos", "ggplot2", "tmap", "leaflet", "DT", "dplyr", "rnaturalearth", "rmarkdown", "flexdashboard", "SpatialEpi", "wbstats")) install.packages("INLA", repos = "https://inla.r-inla-download.org/R/stable", dep = TRUE) ``` # Course materials Course website: https://www.paulamoraga.com/course-gds/ Geospatial Health Data: Modeling and Visualization with R-INLA and Shiny by Paula Moraga (CRC, 2019): https://paula-moraga.github.io/book-geospatial/ <!-- #--- <div style="margin-top:-20px;"></div> .pull-left-60[ # Current <p style = 'margin-bottom: -15px;'></p> - Asst. Professor of Statistics at KAUST - PI GeoHealth group ] .pull-right-40[ <img src="./figures/kaustlogo.png" style="width:100%; margin-top:0.2px; margin-bottom:20px;"/> ] <div style="margin-top:-10px;"></div> # Education <p style = 'margin-bottom: -15px;'></p> - PhD Mathematics, University of Valencia, 2012 - MSc Biostatistics, Harvard University, 2011 - BSc Mathematics, University of Valencia, 2006 Erasmus Johannes Gutenberg University Mainz <div style="margin-top:-20px;"></div> # Experience <div style="margin-top:-20px;"></div> <img src="./figures/jobstimeline.png" style="width:100%;"/> --> --- class: inverse, center, middle # Overview of the R ecosystem ### R, IDE, packages, resources --- <div style="margin-top:-30px;"></div> # Installing R [R](https://www.r-project.org) is a free, open source, software environment for statistical computing and graphics with many excellent packages for importing and manipulating data, modeling, and visualization. R can be downloaded and installed from [CRAN](https://cran.rstudio.com). <img src="./figures/cran.png" style="width:100%;"/> --- <div style="margin-top:-30px;"></div> # Installing RStudio It is recommended to run R using the RStudio integrated development environment (IDE) which can be downloaded from the [RStudio website](https://www.rstudio.com/products/rstudio/download). <!-- RStudio IDE contains several panes for different purposes. --> <img src="./figures/rstudio3.png" style="width:100%;"/> --- background-image: url(./figures/baser1.png) background-size: contain <!-- https://iqss.github.io/dss-workshops/R/Rintro/base-r-cheat-sheet.pdf --> --- background-image: url(./figures/baser2.png) background-size: contain --- <div style="margin-top:-40px"></div> # Installing R packages We can install additional R packages for data retrieval, manipulation, analysis, visualization, and reporting To install an R package from CRAN, use `install.packages()` passing the name of the package as first argument. Then, to use it, load it with `library()` ```r install.packages("sf") library(sf) ``` [Tidyverse](https://www.tidyverse.org/): a collection of R packages for data science <center> <img src="./figures/tidyverse2.png" style="width:46%;"/> </center> --- <div style="margin-top:-40px"></div> # Simple Features for R <div style="margin-top:-20px"></div> https://r-spatial.github.io/sf/ <center> <img src="./figures/sf.png" style="width:80%;"/> </center> --- <div style="margin-top:-20px"></div> # https://rspatialdata.github.io/ | Data | R package | Database | |:------------- |:-------------|:-----| | Administrative boundaries | rgeoboundaries | [geoBoundaries](https://www.geoboundaries.org/) | | Population | wopr | [WorldPop](https://www.worldpop.org/) | | OpenStreetMap | osmdata | [OpenStreetMap (OSM)](https://www.openstreetmap.org/) | | Elevation | elevatr | [AWS Terrain Tiles](https://registry.opendata.aws/terrain-tiles/) | | Temperature | raster | [WorldClim](https://www.worldclim.org/) | | Rainfall | nasapower | [NASA-POWER Project](https://power.larc.nasa.gov/) | | Humidity | nasapower | [NASA-POWER Project](https://power.larc.nasa.gov/) | | Vegetation | MODIStsp | [MODIS](https://modis.gsfc.nasa.gov/data/dataprod/) | | Land cover | MODIStsp | [MODIS](https://modis.gsfc.nasa.gov/data/dataprod/) | | Air pollution | openair | [UK Department Environment Food & Rural Affairs](https://uk-air.defra.gov.uk/) | | Demographic and Health Surveys (DHS) | rdhs | [DHS Program](https://www.dhsprogram.com/) | | Malaria | malariaAtlas |[Malaria Atlas Project (MAP)](https://malariaatlas.org/data-project/) | --- # ggplot2 https://ggplot2.tidyverse.org/ <center> <img src="./figures/ggplot2.png" style="width:80%;"/> </center> --- <div style="margin-top:-40px"></div> # Interactive visualizations with HTML widgets <div style="margin-top:-20px"></div> HTML widgets are interactive web visualizations built with JavaScript http://www.htmlwidgets.org/ <center> <div style="margin-left:-50px; margin-right:-50px; width:100%;"> <img src="./figures/gdygraphs.gif" style="margin-left:-50px; width:50%;"/> <img src="./figures/gdatatable.gif" style="margin-right:-50px; width:50%;"/> </div> </center> <center> <img src="./figures/gleaflet.gif" style="width:70%;"/> </center> --- <div style="margin-top:-30px"></div> # Reproducible documents with R Markdown <div style="margin-top:-10px"></div> **R Markdown** can be used to turn our analysis into fully reproducible documents that can be shared with others https://rmarkdown.rstudio.com/ <img src="./figures/rmarkdown.png" width="100%" style="display: block; margin: auto;" /> --- <div style="margin-top:-30px"></div> # Interactive dashboards and Shiny apps <div style="margin-top:-20px"></div> **flexdashboard** uses R Markdown to publish a group of related data visualizations as a dashboard https://rmarkdown.rstudio.com/flexdashboard/ **Shiny** is a web application framework for R that enables to build interactive web applications https://shiny.rstudio.com/ <img src="./figures/pm3.gif" width="100%" style="display: block; margin: auto;" /> <!-- #--- class: inverse, center, middle # R-spatial applications ### Wide range of disciplines such as environment, health, agriculture, climate, ecology, economy, and society. Spatial analysis can help governments, companies and citizens improve decision-making #--- background-image: url(./figures/applications-urban.png) background-size: contain # Urban analysis <div style="color: gray; height: 20px;bottom:100px;left: 80px;position: fixed;"> <br><br> <a href='https://urbanspatial.github.io/PublicPolicyAnalytics/' target='_blank'>Ken Steif. Public Policy Analytics: Code & Context for Data Science in Government (2020, CRC Press) http://urbanspatial.github.io/PublicPolicyAnalytics</a><br> </div> #--- background-image: url(./figures/applications-bike.png) background-size: contain # Transport planning <div style="color: gray; height: 20px;bottom:100px;left: 80px;position: fixed;"> <br><br> <a href='https://doi.org/10.1016/j.tranpol.2020.06.015' target='_blank'>Lovelace, et al. Transport Policy, 47-54, 2020</a><br> </div> #--- background-image: url(./figures/overviewsoftware2.png) background-size: contain # Health surveillance <div style="color: gray; height: 20px;bottom:100px;left: 80px;position: fixed;"> <br><br> <a href='https://f1000research.com/articles/7-1374/v3' target='_blank'>Moraga, et al. F1000 Research, 7:1374, 2019</a><br> <a href='https://doi.org/10.1016/j.sste.2017.08.001' target='_blank'>Moraga. Spatial and Spatio-temporal Epidemiology, 23:47-57, 2017</a><br> </div> --> --- <br><br><br><br><br> # https://www.paulamoraga.com/course-gds/ --- class: inverse <table style="margin:0px; margin-left:-10px; border-top:0; border-bottom:0;"> <tr> <td style="width: 440px;"> <div style = 'margin-top: 60px; margin-bottom: 40px;'> <span style = 'font-size: 68px; line-height:1.5; font-weight:bold'> Thanks!<br> </span> </div> <span style = 'font-size: 38px; font-weight:bold'> Paula Moraga<br> </span> <br> <span style = 'font-size: 28px; line-height:1.5'> <a href='http://twitter.com/Paula_Moraga_' target='_blank'> <i class='fa fa-twitter fa-fw'></i> @Paula_Moraga_</a><br> <a href='https://Paula-Moraga.github.io/' target='_blank'><i class='fa fa-globe fa-fw'></i> www.PaulaMoraga.com</a><br> </span> </td> <td> <div style = 'margin-top: 120px; margin-bottom: 40px;'> </div> <center> <img src="./figures/logogeohealthdarkbackground.png" height = "220" alt = "a png"><br><br> <img src="./figures/Statistics at KAUST_Logo for digital use_small.png" height = "160" alt = "a png"> </center> </td> </tr> </table> </div>