SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
1
Intro to Spatial Data Science
with R
Alí Santacruz
amsantac.co
JULY 2016
2
About me
• Expert in geomatics with a background in environmental sciences
• R geek
• PhD candidate in Geography
• Interested in Spatial Data Science
• Author of several R packages (available on CRAN)
3
Purpose of this talk
• Discuss what Spatial Data Science is
• Give an introductory explanation about how to conduct Spatial Data
Science with R
4
What is Spatial Data Science?
Spatial Data Scientist (n.):
Statistician GIS/RS expertGIS developer Software
engineer
Spatial Data
Scientist
Spatial Data Science
Data Science
Spatial
Person that is better in spatial data analysis than a GIS developer and
better in software engineering than a GIS/RS expert
5
Spatial Data Science
All they are combined for data
analysis in order to …
Support a better decision
making
"The key word in data science is not data; it is science"
Jeff Leek. Data Science Specialization. Coursera.
6
Spatial
Data
Scientist
Modified from
gettingsmart.com
7
Hacking skills
• Programming languages: Python and R (and others)
http://www.kdnuggets.com/2016/06/r-python-top-analytics-data-mining-data-science-software.html
8
Why should we use R?
• Free and open-source
• A large and comprehensive set of packages (> 8600)
• Data access
• Data cleaning
• Analysis
• Visualization and report generation
• Excellent development environments – RStudio IDE
• An active and friendly developers community
• A huge users community: > 2 million
9
Why R for spatial analysis
• 160+ packages in CRAN Task View: Analysis of Spatial Data
• Classes for spatial (and spatio-temporal) data
• Spatial data import/export
• Exploratory spatial data analysis
• Support for vector and raster operations
• Spatial statistics
• Data visualization through static and dynamic (web) graphics
• Integration with GIS software
• Easy integration with techniques from non-spatial packages
10
R classes for spatial data
• Before 2003:
• Several packages with different assumptions on how spatial data was structured
• From 2003:
• ‘sp’ package: extends R classes and methods for spatial data (vector and raster)
• From 2010:
• ‘raster’ package: deals with raster files stored in disk that are too large to be
loaded on memory (RAM)
11
R classes for spatial data
SpatialPointsDataFrame SpatialLinesDataFrame SpatialPolygonsDataFrame
SpatialPixelsDataFrame
SpatialGridDataFrame
sp package
RasterLayer
RasterStack
RasterBrick
raster package
(recommended)
12
The Data
Science
Process
Modified from science2knowledge
Reproducibility
13
MODELAR
los datos
MODEL
the data
EXPLORAR
los datos
EXPLORE
the data
PREPARAR
los datos
PREPARE
the data
• Is this A or B or C? :: classification
• Is this weird? :: anomaly detection
• How much/how many? :: regression
• How is it organized? :: clustering
• How will it change? :: prediction
"The key word in data science is not data; it is science"
Jeff Leek. Data Science Specialization. Coursera.
OBTENER
los datos
GET
the data
Domain expertise
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMUNICAR
los resultados
COMMUNICATE
the results
14
• Import vector layers: rgdal, raster packages
• Import raster layers: raster package
• Get geocoded data from APIs: twitteR package, see example
• Download satellite images/geographic data: raster, modis, MODISTools packages
For this slide and following ones see code
and examples in in this webpage
MODELAR
los datos
MODEL
the data
EXPLORAR
los datos
EXPLORE
the data
PREPARAR
los datos
PREPARE
the data
GET
the data
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMUNICAR
los resultados
COMMUNICATE
the results
15
• Data cleaning, subset, etc.
• Manipulate data with “verbs” from dplyr and other Hadley-verse packages
• Spatial subset (sp, raster packages)
• Vector operations:
• Operations on the attribute table (sp package)
• Overlay: union, intersection, clip, extract values from raster data using
points/polygons (raster, rgeos packages)
• Dissolve (sp, rgeos packages), buffer (rgeos package)
• Rasterize vector data (raster package)
• Raster operations:
• Map algebra, spatial filters, resampling, … (raster package)
• Vectorize raster data (rgdal, raster packages)
For slides 14 - 18 see code and examples
in this webpage
MODELAR
los datos
MODEL
the data
EXPLORAR
los datos
EXPLORE
the data
PREPARE
the data
OBTENER
los datos
GET
the data
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMUNICAR
los resultados
COMMUNICATE
the results
16
• Descriptive statistics: central tendency and spread measures
• Exploratory graphics (2D, 3D): scatter plot, box plot, histogram, …
• Spatial autocorrelation:
• Global spatial autocorrelation statistics: Moran’s I, Geary’s C, Getis and Ord’s
G(d) (spdep package)
• Local spatial autocorrelation statistics: Moran’s Ii, Getis and Ord’s Gi y Gi*(d)
(spdep package)
MODELAR
los datos
MODEL
the data
EXPLORE
the data
PREPARAR
los datos
PREPARE
the data
OBTENER
los datos
GET
the data
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMUNICAR
los resultados
COMMUNICATE
the results
For slides 14 - 18 see code and examples
in this webpage
17
• Regression:
• Spatial autoregressive models (spdep package)
• Geographically weighted regression (spgwr package)
• Classification (Machine Learning):
• Supervised: RandomForests, SVM, boosting, … (caret package)
• Non-supervised: k-means clustering (stats package)
• Spatial statistics:
• Geostatistics (gstat, geoR, geospt packages and others)
• Spatial point patterns (spatstat package)
MODEL
the data
EXPLORAR
los datos
EXPLORE
the data
PREPARAR
los datos
PREPARE
the data
OBTENER
los datos
GET
the data
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMUNICAR
los resultados
COMMUNICATE
the results
For slides 14 - 18 see code and examples
in this webpage
18
• Static or interactive maps: tmap, leaflet, mapview packages
• Interactive graphics, web apps and dashboards:
• plotly (example), rcharts, googleVis (example) packages
• shiny, see example
• flexdashboard, see example
MODELAR
los datos
MODEL
the data
EXPLORAR
los datos
EXPLORE
the data
PREPARAR
los datos
PREPARE
the data
OBTENER
los datos
GET
the data
PLANTEAR la
pregunta correcta
PLANTEAR la
pregunta correcta
ASK the right
question
COMMUNICATE
the results
For slides 14 - 18 see code and examples
in this webpage
19
Don’t forget: Reproducibility!
• R code and output for examples shown in this webinar (slides 17-21) can
be reproduced with this .Rmd document using RMarkdown
• See this example about reproducible spatial analysis using interactive
notebooks
• Learn more about reproducible geoscientific research
20
Integrating R with GIS software
• QGIS: see example in this post
• ArcGIS: arcgisbinding package, see example in this post
• GRASS GIS: version 6, spgrass6 package; version 7, rgrass7 package
• gvSIG: more info in this post
• SAGA: RSAGA package
• GME (Geospatial Modelling Environment): more info in this webpage
21
References / Online resources
• Bivand, R., Pebesma, E., Gómez-Rubio, V. 2013. Applied Spatial Data
Analysis with R. New York: Springer. 2nd ed.
• R-SIG-Geo mailing list
• CRAN Task View: Analysis of Spatial Data
• Facebook groups: GIS with R, R project en Español
• Google+ groups: Statistics and R, R Programming for Data Analysis
• My blog: amsantac.co/blog.html
If you have any question feel free to contact me:
amsantac.co/contact.html
Thanks!

Weitere ähnliche Inhalte

Was ist angesagt?

R programming language in spatial analysis
R programming language in spatial analysisR programming language in spatial analysis
R programming language in spatial analysis
Abhiram Kanigolla
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
Uday kumar Devalla
 

Was ist angesagt? (20)

Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
R programming language in spatial analysis
R programming language in spatial analysisR programming language in spatial analysis
R programming language in spatial analysis
 
Spatial data analysis
Spatial data analysisSpatial data analysis
Spatial data analysis
 
Digital Soil Mapping steps
Digital Soil Mapping stepsDigital Soil Mapping steps
Digital Soil Mapping steps
 
Geodatabase: The ArcGIS Mechanism for Data Management
Geodatabase: The ArcGIS Mechanism for Data ManagementGeodatabase: The ArcGIS Mechanism for Data Management
Geodatabase: The ArcGIS Mechanism for Data Management
 
Introduction to gis
Introduction to gisIntroduction to gis
Introduction to gis
 
Intro to GIS and Remote Sensing
Intro to GIS and Remote SensingIntro to GIS and Remote Sensing
Intro to GIS and Remote Sensing
 
An introduction to geographic information systems (gis) m goulbourne 2007
An introduction to geographic information systems (gis)   m goulbourne 2007An introduction to geographic information systems (gis)   m goulbourne 2007
An introduction to geographic information systems (gis) m goulbourne 2007
 
Components of Spatial Data Quality in GIS
Components of Spatial Data Quality in GISComponents of Spatial Data Quality in GIS
Components of Spatial Data Quality in GIS
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
Web Based GIS
Web Based GISWeb Based GIS
Web Based GIS
 
Architecting the ArcGIS Platform
Architecting the ArcGIS PlatformArchitecting the ArcGIS Platform
Architecting the ArcGIS Platform
 
Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1
 
Open Source GIS
Open Source GISOpen Source GIS
Open Source GIS
 
Raster processing
Raster processingRaster processing
Raster processing
 
Developing Efficient Web-based GIS Applications
Developing Efficient Web-based GIS ApplicationsDeveloping Efficient Web-based GIS Applications
Developing Efficient Web-based GIS Applications
 
Remote Sensing Imagery & Artificial Intelligence
Remote Sensing Imagery & Artificial IntelligenceRemote Sensing Imagery & Artificial Intelligence
Remote Sensing Imagery & Artificial Intelligence
 
Spatial Database Systems
Spatial Database SystemsSpatial Database Systems
Spatial Database Systems
 
Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)
 

Ähnlich wie Spatial Data Science with R

Exploring Abandoned GIS Research to Augment Applied Geography Education
Exploring Abandoned GIS Research to Augment Applied Geography EducationExploring Abandoned GIS Research to Augment Applied Geography Education
Exploring Abandoned GIS Research to Augment Applied Geography Education
Michael DeMers
 

Ähnlich wie Spatial Data Science with R (20)

Essentials of R
Essentials of REssentials of R
Essentials of R
 
Big Data and Geospatial with HPCC Systems
Big Data and Geospatial with HPCC SystemsBig Data and Geospatial with HPCC Systems
Big Data and Geospatial with HPCC Systems
 
ESWC 2019 - A Software Framework and Datasets for the Analysis of Graphs Meas...
ESWC 2019 - A Software Framework and Datasets for the Analysis of Graphs Meas...ESWC 2019 - A Software Framework and Datasets for the Analysis of Graphs Meas...
ESWC 2019 - A Software Framework and Datasets for the Analysis of Graphs Meas...
 
Geospatial Options in Apache Spark
Geospatial Options in Apache SparkGeospatial Options in Apache Spark
Geospatial Options in Apache Spark
 
Using R to Visualize Spatial Data: R as GIS - Guy Lansley
Using R to Visualize Spatial Data: R as GIS - Guy LansleyUsing R to Visualize Spatial Data: R as GIS - Guy Lansley
Using R to Visualize Spatial Data: R as GIS - Guy Lansley
 
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...
 
Magellen: Geospatial Analytics on Spark by Ram Sriharsha
Magellen: Geospatial Analytics on Spark by Ram SriharshaMagellen: Geospatial Analytics on Spark by Ram Sriharsha
Magellen: Geospatial Analytics on Spark by Ram Sriharsha
 
Apache con big data 2015 magellan
Apache con big data 2015 magellanApache con big data 2015 magellan
Apache con big data 2015 magellan
 
Esta ld -exploring-spatio-temporal-linked-statistical-data
Esta ld -exploring-spatio-temporal-linked-statistical-dataEsta ld -exploring-spatio-temporal-linked-statistical-data
Esta ld -exploring-spatio-temporal-linked-statistical-data
 
ESTA-LD exploring spatio-temporal linked statistical data
ESTA-LD exploring spatio-temporal linked statistical dataESTA-LD exploring spatio-temporal linked statistical data
ESTA-LD exploring spatio-temporal linked statistical data
 
RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018
 
RasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine LearningRasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine Learning
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data science
 
Aag 2017
Aag 2017Aag 2017
Aag 2017
 
Exploring Abandoned GIS Research to Augment Applied Geography Education
Exploring Abandoned GIS Research to Augment Applied Geography EducationExploring Abandoned GIS Research to Augment Applied Geography Education
Exploring Abandoned GIS Research to Augment Applied Geography Education
 
Spatial Data, KML, and the University Web
Spatial Data, KML, and the University WebSpatial Data, KML, and the University Web
Spatial Data, KML, and the University Web
 
rworldmap: A New R package for Mapping Global Data
rworldmap: A New R package for Mapping Global Datarworldmap: A New R package for Mapping Global Data
rworldmap: A New R package for Mapping Global Data
 
Giving MongoDB a Way to Play with the GIS Community
Giving MongoDB a Way to Play with the GIS CommunityGiving MongoDB a Way to Play with the GIS Community
Giving MongoDB a Way to Play with the GIS Community
 
An R primer for SQL folks
An R primer for SQL folksAn R primer for SQL folks
An R primer for SQL folks
 
GIS ANALYTICS-2011
GIS ANALYTICS-2011GIS ANALYTICS-2011
GIS ANALYTICS-2011
 

Kürzlich hochgeladen

+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
gajnagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 

Kürzlich hochgeladen (20)

+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 

Spatial Data Science with R

  • 1. 1 Intro to Spatial Data Science with R Alí Santacruz amsantac.co JULY 2016
  • 2. 2 About me • Expert in geomatics with a background in environmental sciences • R geek • PhD candidate in Geography • Interested in Spatial Data Science • Author of several R packages (available on CRAN)
  • 3. 3 Purpose of this talk • Discuss what Spatial Data Science is • Give an introductory explanation about how to conduct Spatial Data Science with R
  • 4. 4 What is Spatial Data Science? Spatial Data Scientist (n.): Statistician GIS/RS expertGIS developer Software engineer Spatial Data Scientist Spatial Data Science Data Science Spatial Person that is better in spatial data analysis than a GIS developer and better in software engineering than a GIS/RS expert
  • 5. 5 Spatial Data Science All they are combined for data analysis in order to … Support a better decision making "The key word in data science is not data; it is science" Jeff Leek. Data Science Specialization. Coursera.
  • 7. 7 Hacking skills • Programming languages: Python and R (and others) http://www.kdnuggets.com/2016/06/r-python-top-analytics-data-mining-data-science-software.html
  • 8. 8 Why should we use R? • Free and open-source • A large and comprehensive set of packages (> 8600) • Data access • Data cleaning • Analysis • Visualization and report generation • Excellent development environments – RStudio IDE • An active and friendly developers community • A huge users community: > 2 million
  • 9. 9 Why R for spatial analysis • 160+ packages in CRAN Task View: Analysis of Spatial Data • Classes for spatial (and spatio-temporal) data • Spatial data import/export • Exploratory spatial data analysis • Support for vector and raster operations • Spatial statistics • Data visualization through static and dynamic (web) graphics • Integration with GIS software • Easy integration with techniques from non-spatial packages
  • 10. 10 R classes for spatial data • Before 2003: • Several packages with different assumptions on how spatial data was structured • From 2003: • ‘sp’ package: extends R classes and methods for spatial data (vector and raster) • From 2010: • ‘raster’ package: deals with raster files stored in disk that are too large to be loaded on memory (RAM)
  • 11. 11 R classes for spatial data SpatialPointsDataFrame SpatialLinesDataFrame SpatialPolygonsDataFrame SpatialPixelsDataFrame SpatialGridDataFrame sp package RasterLayer RasterStack RasterBrick raster package (recommended)
  • 12. 12 The Data Science Process Modified from science2knowledge Reproducibility
  • 13. 13 MODELAR los datos MODEL the data EXPLORAR los datos EXPLORE the data PREPARAR los datos PREPARE the data • Is this A or B or C? :: classification • Is this weird? :: anomaly detection • How much/how many? :: regression • How is it organized? :: clustering • How will it change? :: prediction "The key word in data science is not data; it is science" Jeff Leek. Data Science Specialization. Coursera. OBTENER los datos GET the data Domain expertise PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMUNICAR los resultados COMMUNICATE the results
  • 14. 14 • Import vector layers: rgdal, raster packages • Import raster layers: raster package • Get geocoded data from APIs: twitteR package, see example • Download satellite images/geographic data: raster, modis, MODISTools packages For this slide and following ones see code and examples in in this webpage MODELAR los datos MODEL the data EXPLORAR los datos EXPLORE the data PREPARAR los datos PREPARE the data GET the data PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMUNICAR los resultados COMMUNICATE the results
  • 15. 15 • Data cleaning, subset, etc. • Manipulate data with “verbs” from dplyr and other Hadley-verse packages • Spatial subset (sp, raster packages) • Vector operations: • Operations on the attribute table (sp package) • Overlay: union, intersection, clip, extract values from raster data using points/polygons (raster, rgeos packages) • Dissolve (sp, rgeos packages), buffer (rgeos package) • Rasterize vector data (raster package) • Raster operations: • Map algebra, spatial filters, resampling, … (raster package) • Vectorize raster data (rgdal, raster packages) For slides 14 - 18 see code and examples in this webpage MODELAR los datos MODEL the data EXPLORAR los datos EXPLORE the data PREPARE the data OBTENER los datos GET the data PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMUNICAR los resultados COMMUNICATE the results
  • 16. 16 • Descriptive statistics: central tendency and spread measures • Exploratory graphics (2D, 3D): scatter plot, box plot, histogram, … • Spatial autocorrelation: • Global spatial autocorrelation statistics: Moran’s I, Geary’s C, Getis and Ord’s G(d) (spdep package) • Local spatial autocorrelation statistics: Moran’s Ii, Getis and Ord’s Gi y Gi*(d) (spdep package) MODELAR los datos MODEL the data EXPLORE the data PREPARAR los datos PREPARE the data OBTENER los datos GET the data PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMUNICAR los resultados COMMUNICATE the results For slides 14 - 18 see code and examples in this webpage
  • 17. 17 • Regression: • Spatial autoregressive models (spdep package) • Geographically weighted regression (spgwr package) • Classification (Machine Learning): • Supervised: RandomForests, SVM, boosting, … (caret package) • Non-supervised: k-means clustering (stats package) • Spatial statistics: • Geostatistics (gstat, geoR, geospt packages and others) • Spatial point patterns (spatstat package) MODEL the data EXPLORAR los datos EXPLORE the data PREPARAR los datos PREPARE the data OBTENER los datos GET the data PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMUNICAR los resultados COMMUNICATE the results For slides 14 - 18 see code and examples in this webpage
  • 18. 18 • Static or interactive maps: tmap, leaflet, mapview packages • Interactive graphics, web apps and dashboards: • plotly (example), rcharts, googleVis (example) packages • shiny, see example • flexdashboard, see example MODELAR los datos MODEL the data EXPLORAR los datos EXPLORE the data PREPARAR los datos PREPARE the data OBTENER los datos GET the data PLANTEAR la pregunta correcta PLANTEAR la pregunta correcta ASK the right question COMMUNICATE the results For slides 14 - 18 see code and examples in this webpage
  • 19. 19 Don’t forget: Reproducibility! • R code and output for examples shown in this webinar (slides 17-21) can be reproduced with this .Rmd document using RMarkdown • See this example about reproducible spatial analysis using interactive notebooks • Learn more about reproducible geoscientific research
  • 20. 20 Integrating R with GIS software • QGIS: see example in this post • ArcGIS: arcgisbinding package, see example in this post • GRASS GIS: version 6, spgrass6 package; version 7, rgrass7 package • gvSIG: more info in this post • SAGA: RSAGA package • GME (Geospatial Modelling Environment): more info in this webpage
  • 21. 21 References / Online resources • Bivand, R., Pebesma, E., Gómez-Rubio, V. 2013. Applied Spatial Data Analysis with R. New York: Springer. 2nd ed. • R-SIG-Geo mailing list • CRAN Task View: Analysis of Spatial Data • Facebook groups: GIS with R, R project en Español • Google+ groups: Statistics and R, R Programming for Data Analysis • My blog: amsantac.co/blog.html
  • 22. If you have any question feel free to contact me: amsantac.co/contact.html Thanks!