Skip to content
Snippets Groups Projects
Commit 6e4a1a00 authored by lucas.longour_ird.fr's avatar lucas.longour_ird.fr
Browse files

improve dataset part

parent 7dd5caba
No related branches found
No related tags found
No related merge requests found
Pipeline #1062 passed
......@@ -4,8 +4,35 @@ bibliography: references.bib
# Data Acquisition
All the data needed to complete this training can be retrieved at [this link](https://e1.pcloud.link/publink/show?code=XZQ60YZxwN09vWJ8bmuSivWezhuG8u94lCV).
## Online databases
### On global scale
Since the appearance of the `sf` package, which has greatly contributed to the popularization of spatial data manipulation with R, many packages for making geographic data (geometries and/or attributes) available have been developed. Most of them are API packages that allow to query data made available on the Web, directly with R. This chapter presents a non-exhaustive list of them.
- <img src="img/geom.svg" alt="Geometries" width="20"/> `rnaturalearth` [@R-rnaturalearth]: retrieves [Natural Earth map data](https://www.naturalearthdata.com/).\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `gadmr` [@R-gadmr]: retrieves data from the [GADM](https://gadm.org/index.html) (national and sub-national administrative divisions of all countries in the world).\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `rgeoboundaries` [@R-rgeoboundaries] : R client for the [geoBoundaries API](https://www.geoboundaries.org/index.html), providing political administrative boundaries of countries.
- <img src="img/geom.svg" alt="Geometries" width="20"/> `cshapes` [@R-cshapes]: makes available national boundaries, from 1886 to present.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `osmextract` [@R-osmextract]: allows importing [OpenStreetMap data](https://www.openstreetmap.org/).
- <img src="img/geom.svg" alt="Geometries" width="20"/> `osmdata` [@osmdata2017]: to download and use OpenStreetMap data.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `maptiles` [@R-maptiles] : This package downloads, composes and displays tiles from a large number of providers (*OpenStreetMap*, *Stamen*, *Esri*, *CARTO* or *Thunderforest*).\
- <img src="img/table.svg" alt="attribute data" width="20"/> `geonames` [@R-geonames] : allows you to query the [geonames DB](http://www.geonames.org/), which provides locations in particular.
- <img src="img/table.svg" alt="attribute data" width="20"/> `wbstats` [@wbstats2020] and `WDI` [@R-WDI]: provide access to World Bank data and statistics.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `sen2r` [@R-sen2r]: allows automatic download and preprocessing of Sentinel-2 satellite data.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `MODIStsp` [@MODIStsp2016]: find, download and process *MODIS* images.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `geodata` [@R-geodata]: provides access to [data](https://github.com/rspatial/geodata) on climate, elevation, soil, species occurrence and administrative boundaries.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `elevatr` [@R-elevatr]: provides access to elevation data made available by [*Amazon Web Services Terrain Tiles*](https://registry.opendata.aws/terrain-tiles/), the [*Open Topography Global Datasets API*](https://opentopography.org/developers/) and the [*USGS Elevation Point Query Service*](https://nationalmap.gov/epqs/).
- <img src="img/geom.svg" alt="Geometries" width="20"/> `rgee` [@R-rgee]: allows use of the [Google Earth Engine](https://www.google.com/intl/fr_in/earth/education/tools/google-earth-engine/) API, a public data catalog and computational infrastructure for satellite images.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> `nasapower` [@nasapower2018]: *NASA* client API (global energy resource forecasting, meteorology, surface solar energy, and climatology).
- <img src="img/geom.svg" alt="Geometries" width="20"/> `geoknife` [@geoknife2015]: allows processing (online) of large raster data from the *Geo Data Portal* of the *U.S. Geological Survey*.\
- <img src="img/table.svg" alt="attribute data" width="20"/> `wopr` [@R-wopr]: provides API access to the [*WorldPop Open Population Repository*](https://wopr.worldpop.org/) database.\
- <img src="img/geom.svg" alt="Geometries" width="20"/> <img src="img/table.svg" alt="attribute data" width="20"/> `rdhs` [@rdhs2019] : [Demographic and Health Survey (DHS) client API and data managements](https://dhsprogram.com/).
Several data sets are referenced by the ESoR (Environnement, Societies and Health Risk) research group [here](https://www.netvibes.com/geohealth?page=geohealth#Online_databases)
## OpenStreetMap
::: {style="float: right"}
......@@ -111,7 +138,6 @@ The result contains a point layer and a polygon layer. The polygon layer contain
sf_use_s2(FALSE)
```
```{r osmdata2, class.output="code-out", warning=FALSE, message=FALSE}
hospital_point <- hospital$osm_points
hospital_poly <- hospital$osm_polygons #Extracting centroids of polygons
......
This diff is collapsed.
public/02-data_acquisition_files/figure-html/display_point-1.png

1.11 MiB | W: | H:

public/02-data_acquisition_files/figure-html/display_point-1.png

1.11 MiB | W: | H:

public/02-data_acquisition_files/figure-html/display_point-1.png
public/02-data_acquisition_files/figure-html/display_point-1.png
public/02-data_acquisition_files/figure-html/display_point-1.png
public/02-data_acquisition_files/figure-html/display_point-1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -413,14 +413,14 @@ Statistical test
Model used when sampling: Poisson
Number of simulations: 499
Statistic: 0.1566449
p-value : 0.008 </code></pre>
p-value : 0.01 </code></pre>
</div>
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(m_test)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="07-basic_statistics_files/figure-html/MoransI-1.png" class="img-fluid" width="768"></p>
</div>
</div>
<p>The Moran’s statistics is here <span class="math inline">\(I =\)</span> 0.16. When comparing its value to the H0 distribution (built under 499 simulations), the probability of observing such a I value under the null hypothesis, i.e.&nbsp;the distribution of cases is spatially independent, is <span class="math inline">\(p_{value} =\)</span> 0.008. We therefore reject H0 with error risk of <span class="math inline">\(\alpha = 5\%\)</span>. The distribution of cases is therefore autocorrelated across districts in Cambodia.</p>
<p>The Moran’s statistics is here <span class="math inline">\(I =\)</span> 0.16. When comparing its value to the H0 distribution (built under 499 simulations), the probability of observing such a I value under the null hypothesis, i.e.&nbsp;the distribution of cases is spatially independent, is <span class="math inline">\(p_{value} =\)</span> 0.01. We therefore reject H0 with error risk of <span class="math inline">\(\alpha = 5\%\)</span>. The distribution of cases is therefore autocorrelated across districts in Cambodia.</p>
<div class="callout-note callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
......@@ -541,7 +541,7 @@ Statistic distributions
<span id="cb28-7"><a href="#cb28-7" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(df_secondary_clusters)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre class="code-out"><code> SMR number.of.cases expected.cases p.value
1 3.767698 16 4.246625 0.02</code></pre>
1 3.767698 16 4.246625 0.012</code></pre>
</div>
</div>
<p>We only have one secondary cluster composed of one district.</p>
......
public/07-basic_statistics_files/figure-html/MoransI-1.png

19 KiB | W: | H:

public/07-basic_statistics_files/figure-html/MoransI-1.png

18 KiB | W: | H:

public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
public/07-basic_statistics_files/figure-html/MoransI-1.png
  • 2-up
  • Swipe
  • Onion skin
public/07-basic_statistics_files/figure-html/kd_test-1.png

44 KiB | W: | H:

public/07-basic_statistics_files/figure-html/kd_test-1.png

44 KiB | W: | H:

public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
public/07-basic_statistics_files/figure-html/kd_test-1.png
  • 2-up
  • Swipe
  • Onion skin
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="globe-americas" class="svg-inline--fa fa-globe-americas fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111.03 8 0 119.03 0 256s111.03 248 248 248 248-111.03 248-248S384.97 8 248 8zm82.29 357.6c-3.9 3.88-7.99 7.95-11.31 11.28-2.99 3-5.1 6.7-6.17 10.71-1.51 5.66-2.73 11.38-4.77 16.87l-17.39 46.85c-13.76 3-28 4.69-42.65 4.69v-27.38c1.69-12.62-7.64-36.26-22.63-51.25-6-6-9.37-14.14-9.37-22.63v-32.01c0-11.64-6.27-22.34-16.46-27.97-14.37-7.95-34.81-19.06-48.81-26.11-11.48-5.78-22.1-13.14-31.65-21.75l-.8-.72a114.792 114.792 0 0 1-18.06-20.74c-9.38-13.77-24.66-36.42-34.59-51.14 20.47-45.5 57.36-82.04 103.2-101.89l24.01 12.01C203.48 89.74 216 82.01 216 70.11v-11.3c7.99-1.29 16.12-2.11 24.39-2.42l28.3 28.3c6.25 6.25 6.25 16.38 0 22.63L264 112l-10.34 10.34c-3.12 3.12-3.12 8.19 0 11.31l4.69 4.69c3.12 3.12 3.12 8.19 0 11.31l-8 8a8.008 8.008 0 0 1-5.66 2.34h-8.99c-2.08 0-4.08.81-5.58 2.27l-9.92 9.65a8.008 8.008 0 0 0-1.58 9.31l15.59 31.19c2.66 5.32-1.21 11.58-7.15 11.58h-5.64c-1.93 0-3.79-.7-5.24-1.96l-9.28-8.06a16.017 16.017 0 0 0-15.55-3.1l-31.17 10.39a11.95 11.95 0 0 0-8.17 11.34c0 4.53 2.56 8.66 6.61 10.69l11.08 5.54c9.41 4.71 19.79 7.16 30.31 7.16s22.59 27.29 32 32h66.75c8.49 0 16.62 3.37 22.63 9.37l13.69 13.69a30.503 30.503 0 0 1 8.93 21.57 46.536 46.536 0 0 1-13.72 32.98zM417 274.25c-5.79-1.45-10.84-5-14.15-9.97l-17.98-26.97a23.97 23.97 0 0 1 0-26.62l19.59-29.38c2.32-3.47 5.5-6.29 9.24-8.15l12.98-6.49C440.2 193.59 448 223.87 448 256c0 8.67-.74 17.16-1.82 25.54L417 274.25z"></path></svg>
\ No newline at end of file
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="table" class="svg-inline--fa fa-table fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z"></path></svg>
\ No newline at end of file
This diff is collapsed.
......@@ -405,3 +405,11 @@ Library},
year = {2022},
date = {2022}
}
@article{rnaturalearth,
title = {rnaturalearth: World Map Data from Natural Earth},
author = {South, Andy},
year = {2017},
date = {2017},
url = {https://CRAN.R-project.org/package=rnaturalearth}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment