Using R as geo-statistical tool:
a few examples French Institute of Pondicherry
19th august 2015
Maxime Réjou-Méchain [email protected]
in a nutshell
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
• Free and open-source! • Command line based program • Environment for analyzing data
• Great tool for graphical visualization
in a nutshell
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
• Free and open-source! • Command line based program • Environment for analyzing data
• Great tool for graphical visualization
Scientists and researches have implemented thousands of specialized procedures for a wide variety of applications as contributed packages
R is also a social movement: MANY forums on the net!!!
Specific add-ons, analogous to extentions in ArcGIS and QGIS
activity?
http://spatial.ly/2013/06/r_activity/
Map scaled according to the number of server requests made.
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
India is already converted to the R power!
as a geospatial tool?!
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the
operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)
R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the
operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)
as a geospatial tool?!
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
R has increasingly gained GIS capabilities, and is now able to perform most (if not all) the
operations we typically do with purely GIS software (e.g. SAGA, GRASS, DIVA-GIS, or QGIS)
as a geospatial tool?!
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Incorporated in QGIS
“ “spatial” packages
ade4 adehabitat adehabitatHR adehabitatHS adehabitatLT adehabitatMA ads akima AMOEBA ash aspace automap CARBayes classInt (core) CompRandFld constrainedKriging cshapes dbmss DCluster (core) deldir (core) DSpat ecespa fields FieldSim gdistance Geneland GEOmap geomapdata geonames geoR (core) geoRglm georob geospacom geosphere geospt GeoXp
ggmap glmmBUGS gmt Grid2Polygons GriegSmith gstat (core) Guerry GWmodel gwrr hdeco intamap landsat latticeDensity leafletR mapdata mapproj maps maptools (core) marmap MBA McSpatial micromap ModelMap ncdf ncf ngspatial nlme OpenStreetMap osmar pastecs PBSmapping PBSmodelling plotGoogleMaps plotKML PReMiuM psgp
ramps RandomFields (core) rangeMapper RArcInfo raster (core) rasterVis RColorBrewer (core) regress rgdal (core) rgeos (core) RgoogleMaps rgrass7 RPyGeo RSAGA RSurvey rtop rworldmap rworldxtra seg sgeostat shapefiles siplab sp (core) spacetime (core) spacom spaMM sparr spatcounts spatgraphs spatial spatial.tools spatialCovariance SpatialEpi SpatialExtremes spatialkernel spatialprobit
spatialsegregation SpatialTools spatstat (core) spBayes spcosa spdep (core) spgrass6 spgwr sphet splancs (core) splm spsurvey spTimer SSN Stem taRifx tgp tmap trip tripack tripEstimation UScensus2000cdp UScensus2000tract vardiag vec2dtransf vegan wkb
> 130 packages!
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
containing R functions, datasets and documentation including examples of how to use the
functions
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
“ “spatial” forums
Geo-examples
1) Mapping the westernGhats diversity
2) Modelling anthropic disturbance in Africa
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Modelling anthropic disturbance in Central Africa
gROADSv1 (NASA)
Grumpv1 (NASA)
FAO rivers (Strahler index <6)
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Shorter distance to a road, river or railway
= DistTransport
gROADSv1 (NASA)
Steps 1) Shapefile to raster
with 0/1 2) Distance to the
closest 1 3) Distance from
points (towns) 4) Weibull model
construction 5) InflVilles=X%*POP
Modelling anthropic disturbance in Central Africa
Grumpv1 (NASA)
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Distance to nearest town
b=POP^Beta
0%
100%
DistTransport
Steps 1) Shapefile to raster
with 0/1 2) Distance to the
closest 1 3) Distance from
points (towns) 4) Weibull model
construction 5) TownInfluence
POPXnceTownInflue %
Modelling anthropic disturbance in Central Africa
Grumpv1 (NASA)
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
gROADSv1 (NASA)
DistTransport
TownInfluence
Steps 1) Shapefile to raster
with 0/1 2) Distance to the
closest 1 3) Distance from
points (towns) 4) Weibull model
construction 5) TownInfluence
6) Normalisation
7) Index calculation
))1(max(
)1(
Xsqrt
XsqrtXnorm
ortDistTransp
nceTownInflueAI log
POPXnceTownInflue %
Modelling anthropic disturbance in Central Africa
gROADSv1 (NASA)
Grumpv1 (NASA)
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Beta=0.05 Beta=0.1 Beta=0.2
Modelling anthropic disturbance in Central Africa
Beta=0.25 Beta=0.3 Beta=0.4
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
MODIS forest map
Modelling anthropic disturbance in Central Africa
Two calibration/validation areas
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Markov Chain Monte Carlo…… (Beta ≈0.29) (performance AUC=0.78 et 0.68)
Modelling anthropic disturbance in Central Africa
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
POP 2000 POP 2000 x 2
Modelling anthropic disturbance in Central Africa
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
POP 2000 POP 2000 x 2
DIFFERENCES
Modelling anthropic disturbance in Central Africa
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
POP 2000 POP 2000 x 2
DIFFERENCES
Modelling anthropic disturbance in Central Africa
All the procedure includes geostatistical and purely statistical tools thanks to R!
=
AUTOMATED, EASILY REPRODUCTIBLE, EFFICIENT
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
maps from the web
http://spatial.ly/2012/03/mapped-british-shipping-1750-1800/
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
maps from the web
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
maps from the web
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Trade-offs
Summary of the relative merits of R compared with more traditional GIS software
http://www.r-bloggers.com/r-an-integrated-statistical-programming-environment-and-gis/
Let’s use R as a GIS, the investment quickly pay off!
Toward a FOSS5G?
Useful links: https://cran.r-project.org/web/views/Spatial.html http://www.r-bloggers.com/r-an-integrated-statistical-programming-environment-and-gis/ https://stat.ethz.ch/mailman/listinfo/r-sig-geo
French Institute of Pondicherry Using R as geo-statistical tool: a few examples
Conclusion
Thanks
French Institute of Pondicherry Using R as geo-statistical tool: a few examples