`mapMCDA` helps producing **risk maps** by weighting **risk factors** using **expert knowledge**.
`mapMCDA` helps producing **risk maps** by weighting **risk factors**
using **expert knowledge**.
The typical use case is the lack of (reliable) data about the epidemics of a disease, but available information about well known **risk factors** (e.g. animal density, proximity to border, proximity to water courses, etc.).
The typical use case is the lack of (reliable) data about the epidemics
of a disease, but available information about well known **risk
factors** (e.g. animal density, proximity to border, proximity to water
courses, etc.).
In order to design a **stratified sampling** or a **surveillance campaign**, a preliminar risk map based on expert judgement is required.
In order to design a **stratified sampling** or a **surveillance
campaign**, a preliminar risk map based on expert judgement is required.
This package (and method) provides a systematic and guided approach to build such maps.
This package (and method) provides a systematic and guided approach to
build such maps.

The package include a Graphical User Interface (Shiny) that helps in processing and weighting risk factors.
The package include a Graphical User Interface (Shiny) that helps in
processing and weighting risk factors.
``` r
library(mapMCDA)
...
...
@@ -29,16 +38,22 @@ mapMCDA_app()

Installing the package
----------------------
## Installing the package
`mapMCDA` is on its way to CRAN. In the meanwhile, install from GitLab as follows.
`mapMCDA` is on its way to CRAN. In the meanwhile, install from GitLab
as
follows.
<!-- To install the current stable, CRAN version of the package, type: -->
<!-- ```{r install, eval = FALSE} -->
<!-- install.packages("mapMCDA") -->
<!-- ``` -->
<!-- To benefit from the latest features and bug fixes, install the development, version of the package using: -->
For support, reach out in the [mapMCDA mailing list](https://listes.cirad.fr/sympa/info/mapmcda). Archives are of public access.
For support, reach out in the [mapMCDA mailing
list](https://listes.cirad.fr/sympa/info/mapmcda). Archives are of
public access.
Contributions are welcome via **pull requests**.
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of
Conduct](CONDUCT.md). By participating in this project you agree to
<spanclass="fu"><ahref="https://rdrr.io/r/base/cat.html">cat</a></span>(<spanclass="st">"We suggest installing the pacakge mapview for interactive visualisation"</span>,
<spanclass="st">"of cartography from within R"</span>)
<spanclass="co">#> Warning in library(package, lib.loc = lib.loc, character.only = TRUE,</span>
<spanclass="co">#> logical.return = TRUE, : there is no package called 'mapview'</span>
<spanclass="co">#> We suggest installing the pacakge mapview for interactive visualisation of cartography from within R</span></pre></body></html></div>
<spanclass="st">"of cartography from within R"</span>)</pre></body></html></div>
<pre><code>## Warning in proj4string(x): CRS object has comment, which is lost in output
## Warning in proj4string(x): CRS object has comment, which is lost in output
## Warning in proj4string(x): CRS object has comment, which is lost in output
## Warning in proj4string(x): CRS object has comment, which is lost in output</code></pre>
<p>On voudrait examiner les cartes de risque ainsi calculées. Mais pour cela, il faut qu’elles soient <em>alignées</em>. C’est à dire, qu’elles aient les mêmes <em>extents</em>, <em>résolutions</em> et <em>projections</em>.</p>
<p>On peut se servir de la fonction <code><ahref="../reference/align_layers.html">align_layers()</a></code> qui arrange tout ça pour nous. Noter que ce pas n’est pas nécessaire pour continuer, car cette fonction est automatiquement executée si besoin.</p>
<imgsrc="mapMCDA_files/figure-html/align-layers-1.png"alt="Niveaux de risque associé à chaque facteur."width="576"><pclass="caption">
...
...
@@ -202,7 +209,7 @@ Niveaux de risque associé à chaque facteur.
<ahref="#pond%C3%A9ration-des-facteurs-de-risque"class="anchor"></a>3. Pondération des facteurs de risque</h1>
<p>Il y a 3 facteurs à considérer. Il faut comparer 2-à-2 leurs importances relatives en une échelle de 1 à 9 et representer ces rélations en une matrice qui doit avoir des 1 dans son diagonale.</p>
<p>Noter que les élements symmetriques doivent être réciproques.</p>
@@ -239,7 +246,7 @@ Niveaux de risque associé à chaque facteur.
</table>
<p>Dans cette exemple, on considère que la densité animale est 6 fois plus importante que la distance aux points d’eau, et 4 fois plus importante que la distance aux parcs. Au même temps, que la distance aux points d’eau est 3 fois plus importante que celle aux parcs.</p>
<p>Le système calcule les coefficients de pondération les plus consistents avec ces valorations par paires, avec la fonction <code><ahref="../reference/compute_weights.html">compute_weights()</a></code>.</p>
<imgsrc="mapMCDA_files/figure-html/compute-weights-1.png"alt="Pondération des facteurs de risque."width="384"><pclass="caption">
Pondération des facteurs de risque.
...
...
@@ -250,7 +257,7 @@ Pondération des facteurs de risque.
<h1class="hasAnchor">
<ahref="#calcul-de-la-carte-de-risque"class="anchor"></a>4. Calcul de la carte de risque</h1>
<p>La fonction <code><ahref="../reference/wlc.html">wlc()</a></code> (pour weighted linear combination) combine tous les facteurs de risque en utilisant les poids calculés précedament, et produise une carte de risque qui couvre toute la région.</p>
<li><p>Filter national sub-network automatically (with warning) rather than stop on nodes off-boundaries. (#44)</p></li>
<li><p>Warn (instead of error) if all links are unidirectional. Danger: assuming directionality when in reality the data is non-directional. (#41)</p></li>
<li><p>Automatically aggregate volumes for multiple links (with warning, rather than error).</p></li>
<li><p>Stricter check consistency of nodes coordinates. Before, we checked (and errored) whether the same node had different coordinates. Check also for the same coordinates havind different nodes. It is likely a typo in the name of a locality, and we don’t want to treat them as different nodes.</p></li>
</ul>
</li>
<li><p>Accept grd/gri files as raster format.</p></li>
<spanclass='kw pkg'>raster</span><spanclass='kw ns'>::</span><spanclass='fu'><ahref='https://rdrr.io/pkg/raster/man/plot.html'>plot</a></span>(<spanclass='fu'>distance_map</span>(<spanclass='no'>cmr</span>$<spanclass='no'>water_bodies</span>, <spanclass='kw'>boundaries</span><spanclass='kw'>=</span><spanclass='no'>cmr</span>$<spanclass='no'>cmr_admin3</span>))</div><divclass='output co'>#><spanclass='warning'>Warning: CRS object has comment, which is lost in output</span></div><divclass='output co'>#><spanclass='warning'>Warning: CRS object has comment, which is lost in output</span></div><divclass='img'><imgsrc='distance_map-1.png'alt=''width='700'height='433'/></div></pre>