diff --git a/01-introduction.html b/01-introduction.html
new file mode 100644
index 0000000000000000000000000000000000000000..fb06b554865f34795a31ce9069a148e665314106
--- /dev/null
+++ b/01-introduction.html
@@ -0,0 +1,748 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+
+<head>
+
+<meta charset="utf-8" />
+<meta name="generator" content="quarto-1.1.189" />
+
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+
+
+<title>Mapping and spatial analyses in R for One Health studies – 1  Introduction</title>
+<style>
+code{white-space: pre-wrap;}
+span.smallcaps{font-variant: small-caps;}
+div.columns{display: flex; gap: min(4vw, 1.5em);}
+div.column{flex: auto; overflow-x: auto;}
+div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ul.task-list{list-style: none;}
+ul.task-list li input[type="checkbox"] {
+  width: 0.8em;
+  margin: 0 0.8em 0.2em -1.6em;
+  vertical-align: middle;
+}
+pre > code.sourceCode { white-space: pre; position: relative; }
+pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
+pre > code.sourceCode > span:empty { height: 1.2em; }
+.sourceCode { overflow: visible; }
+code.sourceCode > span { color: inherit; text-decoration: inherit; }
+div.sourceCode { margin: 1em 0; }
+pre.sourceCode { margin: 0; }
+@media screen {
+div.sourceCode { overflow: auto; }
+}
+@media print {
+pre > code.sourceCode { white-space: pre-wrap; }
+pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
+}
+pre.numberSource code
+  { counter-reset: source-line 0; }
+pre.numberSource code > span
+  { position: relative; left: -4em; counter-increment: source-line; }
+pre.numberSource code > span > a:first-child::before
+  { content: counter(source-line);
+    position: relative; left: -1em; text-align: right; vertical-align: baseline;
+    border: none; display: inline-block;
+    -webkit-touch-callout: none; -webkit-user-select: none;
+    -khtml-user-select: none; -moz-user-select: none;
+    -ms-user-select: none; user-select: none;
+    padding: 0 4px; width: 4em;
+    color: #aaaaaa;
+  }
+pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
+div.sourceCode
+  {   }
+@media screen {
+pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+}
+code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+code span.at { color: #7d9029; } /* Attribute */
+code span.bn { color: #40a070; } /* BaseN */
+code span.bu { color: #008000; } /* BuiltIn */
+code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+code span.ch { color: #4070a0; } /* Char */
+code span.cn { color: #880000; } /* Constant */
+code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+code span.dt { color: #902000; } /* DataType */
+code span.dv { color: #40a070; } /* DecVal */
+code span.er { color: #ff0000; font-weight: bold; } /* Error */
+code span.ex { } /* Extension */
+code span.fl { color: #40a070; } /* Float */
+code span.fu { color: #06287e; } /* Function */
+code span.im { color: #008000; font-weight: bold; } /* Import */
+code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+code span.op { color: #666666; } /* Operator */
+code span.ot { color: #007020; } /* Other */
+code span.pp { color: #bc7a00; } /* Preprocessor */
+code span.sc { color: #4070a0; } /* SpecialChar */
+code span.ss { color: #bb6688; } /* SpecialString */
+code span.st { color: #4070a0; } /* String */
+code span.va { color: #19177c; } /* Variable */
+code span.vs { color: #4070a0; } /* VerbatimString */
+code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+div.csl-bib-body { }
+div.csl-entry {
+  clear: both;
+}
+.hanging div.csl-entry {
+  margin-left:2em;
+  text-indent:-2em;
+}
+div.csl-left-margin {
+  min-width:2em;
+  float:left;
+}
+div.csl-right-inline {
+  margin-left:2em;
+  padding-left:1em;
+}
+div.csl-indent {
+  margin-left: 2em;
+}
+</style>
+
+<!-- htmldependencies:E3FAD763 -->
+<script id="quarto-search-options" type="application/json">{
+  "location": "sidebar",
+  "copy-button": false,
+  "collapse-after": 3,
+  "panel-placement": "start",
+  "type": "textbox",
+  "limit": 20,
+  "language": {
+    "search-no-results-text": "No results",
+    "search-matching-documents-text": "matching documents",
+    "search-copy-link-title": "Copy link to search",
+    "search-hide-matches-text": "Hide additional matches",
+    "search-more-match-text": "more match in this document",
+    "search-more-matches-text": "more matches in this document",
+    "search-clear-button-title": "Clear",
+    "search-detached-cancel-button-title": "Cancel",
+    "search-submit-button-title": "Submit"
+  }
+}</script>
+<style>html{ scroll-behavior: smooth; }</style>
+
+
+<link rel="stylesheet" href="styles.css" />
+</head>
+
+<body>
+
+<div id="quarto-search-results"></div>
+  <header id="quarto-header" class="headroom fixed-top">
+  <nav class="quarto-secondary-nav" 
+        data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" 
+        aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation"
+        onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"
+  >
+    <div class="container-fluid d-flex justify-content-between">
+      <h1 class="quarto-secondary-nav-title"></h1>
+      <button type="button" 
+        class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
+        <i class="bi bi-chevron-right"></i>
+      </button>
+    </div>
+  </nav>
+</header>
+<!-- content -->
+<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
+<!-- sidebar -->
+  <nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto">
+    <div class="pt-lg-2 mt-2 text-left sidebar-header">
+    <div class="sidebar-title mb-0 py-0">
+      <a href="/">
+      Mapping and spatial analyses in R for One Health studies
+      </a> 
+        <div class="sidebar-tools-main">
+    <a href="https://forge.ird.fr/espace-dev/personnels/longour/geohealth/documentation/rspatial-for-onehealth" title="Source Code" class="sidebar-tool px-1"><i class="bi bi-git"></i></a>
+</div>
+    </div>
+      </div>
+      <div class="mt-2 flex-shrink-0 align-items-center">
+        <div class="sidebar-search">
+        <div id="quarto-search" class="" title="Search"></div>
+        </div>
+      </div>
+    <div class="sidebar-menu-container"> 
+    <ul class="list-unstyled mt-1">
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/index.html" class="sidebar-item-text sidebar-link">Preface</a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/01-introduction.html" class="sidebar-item-text sidebar-link active"><span class='chapter-number'>1</span>  <span class='chapter-title'>Introduction</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/02-data_acquisition.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>2</span>  <span class='chapter-title'>Data Acquisition</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/03-vector_data.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>3</span>  <span class='chapter-title'>Using vector data</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/04-raster_data.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>4</span>  <span class='chapter-title'>Using raster data</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/05-mapping_with_r.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>5</span>  <span class='chapter-title'>Mapping With R</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/07-basic_statistics.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>6</span>  <span class='chapter-title'>Basic statistics for spatial analysis</span></a>
+  </div>
+</li>
+        <li class="sidebar-item">
+  <div class="sidebar-item-container"> 
+  <a href="/references.html" class="sidebar-item-text sidebar-link">References</a>
+  </div>
+</li>
+    </ul>
+    </div>
+</nav>
+<!-- margin-sidebar -->
+    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
+        <div id="quarto-toc-target"></div>
+    </div>
+<!-- main -->
+<main class="content" id="quarto-document-content">
+
+<header id="title-block-header" class="quarto-title-block default">
+<div class="quarto-title">
+<h1 class="title"><span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></h1>
+</div>
+
+
+
+<div class="quarto-title-meta">
+
+    
+    
+  </div>
+  
+
+</header>
+<nav id="TOC" role="doc-toc">
+    <h2 id="toc-title">Table of contents</h2>
+   
+  <ul>
+  <li><a href="#use-of-r" id="toc-use-of-r"><span class="toc-section-number">1.1</span> <span class="header-section-number">1.1</span> Use of R</a>
+  <ul>
+  <li><a href="#installation" id="toc-installation"><span class="toc-section-number">1.1.1</span> <span class="header-section-number">1.1.1</span> Installation</a>
+  <ul>
+  <li><a href="#r" id="toc-r"><span class="toc-section-number">1.1.1.1</span> <span class="header-section-number">1.1.1.1</span> R</a></li>
+  <li><a href="#rstudio" id="toc-rstudio"><span class="toc-section-number">1.1.1.2</span> <span class="header-section-number">1.1.1.2</span> RStudio</a></li>
+  </ul></li>
+  <li><a href="#help" id="toc-help"><span class="toc-section-number">1.1.2</span> <span class="header-section-number">1.1.2</span> Help</a></li>
+  <li><a href="#functions" id="toc-functions"><span class="toc-section-number">1.1.3</span> <span class="header-section-number">1.1.3</span> Functions</a></li>
+  </ul></li>
+  <li><a href="#spatial-in-r-history-and-evolutions" id="toc-spatial-in-r-history-and-evolutions"><span class="toc-section-number">1.2</span> <span class="header-section-number">1.2</span> Spatial in R : History and evolutions</a></li>
+  <li><a href="#the-package-sf" id="toc-the-package-sf"><span class="toc-section-number">1.3</span> <span class="header-section-number">1.3</span> The package <code>sf</code></a>
+  <ul>
+  <li><a href="#format-of-spatial-objects-sf" id="toc-format-of-spatial-objects-sf"><span class="toc-section-number">1.3.1</span> <span class="header-section-number">1.3.1</span> Format of spatial objects <code>sf</code></a></li>
+  </ul></li>
+  <li><a href="#package-mapsf" id="toc-package-mapsf"><span class="toc-section-number">1.4</span> <span class="header-section-number">1.4</span> Package <code>mapsf</code></a></li>
+  <li><a href="#the-package-terra" id="toc-the-package-terra"><span class="toc-section-number">1.5</span> <span class="header-section-number">1.5</span> The package <code>terra</code></a></li>
+  </ul>
+</nav>
+<section id="use-of-r" class="level2" data-number="1.1">
+<h2 data-number="1.1"><span class="header-section-number">1.1</span> Use of R</h2>
+<div class="callout-importan callout callout-style-default no-icon callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon no-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+REMINDER : R TIPS
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<ol type="1">
+<li><p>Comment your code ! (<code># important informations on the code</code>)</p></li>
+<li><p>Check your R objects ! (<code>plot()</code>, <code>print()</code>, <code>View()</code> , …)</p></li>
+<li><p>Listen to R outputs ! (Errors AND Warnings)</p></li>
+<li><p>Get help ! (<code>?name_of_function</code>, internet, others users)</p></li>
+<li><p>Keep calm and take a break !</p></li>
+</ol>
+</div>
+</div>
+<section id="installation" class="level3" data-number="1.1.1">
+<h3 data-number="1.1.1"><span class="header-section-number">1.1.1</span> Installation</h3>
+<div class="callout-note callout callout-style-default callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+Note
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<p>The installation part is based on “<a href="https://intro2r.com/">An Introduction to R</a>” book writed by <em>Alex Douglas, Deon Roos, Francesca Mancini, Ana Couto &amp; David Lusseau</em></p>
+</div>
+</div>
+<section id="r" class="level4" data-number="1.1.1.1">
+<h4 data-number="1.1.1.1"><span class="header-section-number">1.1.1.1</span> R</h4>
+<section id="windows-users" class="level5" data-number="1.1.1.1.1">
+<h5 data-number="1.1.1.1.1"><span class="header-section-number">1.1.1.1.1</span> Windows users</h5>
+<p>For Windows users select the ‘<a href="(https://cran.r-project.org/bin/windows/)">Download R for Windows</a>’ link and then click on the ‘base’ link and finally the download link ‘Download R 4.2.1 for Windows’. This will begin the download of the ‘.exe’ installation file. When the download has completed double click on the R executable file and follow the on-screen instructions. Full installation instructions can be found at the <a href="https://cran.r-project.org/bin/windows/">CRAN website</a>.</p>
+</section>
+<section id="mac-users" class="level5" data-number="1.1.1.1.2">
+<h5 data-number="1.1.1.1.2"><span class="header-section-number">1.1.1.1.2</span> Mac users</h5>
+<p>For Mac users select the ‘<a href="https://cran.r-project.org/bin/macosx/">Download R for (Mac) OS X</a>’ link. The binary can be downloaded by selecting the ‘R-4.2.1.pkg’. Once downloaded, double click on the file icon and follow the on-screen instructions to guide you through the necessary steps. See the ‘<a href="https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html">R for Mac OS X FAQ</a>’ for further information on installation.</p>
+</section>
+<section id="linux-users" class="level5" data-number="1.1.1.1.3">
+<h5 data-number="1.1.1.1.3"><span class="header-section-number">1.1.1.1.3</span> Linux users</h5>
+<p>For Linux users, the installation method will depend on which flavour of Linux you are using. There are reasonably comprehensive instruction <a href="https://cran.r-project.org/bin/linux/">here</a> for Debian, Redhat, Suse and Ubuntu. In most cases you can just use your OS package manager to install R from the official repository. On Ubuntu fire up a shell (Terminal) and use (you will need root permission to do this):</p>
+<div class="cell">
+<div class="sourceCode" id="cb1"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt update</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install r-base r-base-dev</span></code></pre></div>
+</div>
+<p>which will install base R and also the development version of base R (you only need this if you want to compile R packages from source but it doesn’t hurt to have it).</p>
+<p>If you receive an error after running the code above you may need to add a ‘source.list’ entry to your etc/apt/sources.list file. To do this open the terminal and enter this:</p>
+<div class="cell">
+<div class="sourceCode" id="cb2"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> <span class="at">--no-install-recommends</span> software-properties-common dirmngr</span>
+<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Add keys</span></span>
+<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">wget</span> <span class="at">-qO-</span> https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc <span class="kw">|</span> <span class="fu">sudo</span> tee <span class="at">-a</span> /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc</span>
+<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> add-apt-repository <span class="st">&quot;deb https://cloud.r-project.org/bin/linux/ubuntu </span><span class="va">$(</span><span class="ex">lsb_release</span> <span class="at">-cs</span><span class="va">)</span><span class="st">-cran40/&quot;</span></span></code></pre></div>
+</div>
+<p>Once you have done this then re-run the apt commands above and you should be good to go.</p>
+<p>Install the following packages to allow for future spatial data analysis:</p>
+<div class="cell">
+<div class="sourceCode" id="cb3"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> libgdal-dev libproj-dev libgeos-dev libudunits2-dev libv8-dev libnode-dev libcairo2-dev libnetcdf-dev</span></code></pre></div>
+</div>
+</section>
+</section>
+<section id="rstudio" class="level4" data-number="1.1.1.2">
+<h4 data-number="1.1.1.2"><span class="header-section-number">1.1.1.2</span> RStudio</h4>
+<p>Whilst its eminently possible to just use the base installation of R (many people do), we will be using a popular Integrated Development Environment (IDE) called RStudio. RStudio can be thought of as an add-on to R which provides a more user-friendly interface, incorporating the R Console, a script editor and other useful functionality (like R markdown and Git Hub integration). You can find more information about RStudio <a href="https://rstudio.com/">here</a>.</p>
+<p>RStudio is freely available for Windows, Mac and Linux operating systems and can be downloaded from the <a href="https://rstudio.com/products/rstudio/download">RStudio site</a>. You should select the ‘RStudio Desktop’ version. Note: you must install R before you install RStudio.</p>
+<section id="windows-and-mac-users" class="level5" data-number="1.1.1.2.1">
+<h5 data-number="1.1.1.2.1"><span class="header-section-number">1.1.1.2.1</span> Windows and Mac users</h5>
+<p>For Windows and Mac users you should be presented with the appropriate link for downloading. Click on this link and once downloaded run the installer and follow the instructions. If you don’t see the link then scroll down to the ‘All Installers’ section and choose the link manually.</p>
+</section>
+<section id="linux-users-1" class="level5" data-number="1.1.1.2.2">
+<h5 data-number="1.1.1.2.2"><span class="header-section-number">1.1.1.2.2</span> Linux users</h5>
+<p>For Linux users scroll down to the ‘All Installers’ section and choose the appropriate link to download the binary for your Linux operating system. RStudio for Ubuntu (and Debian) is available as a <code>*.deb</code> package.</p>
+<p>To install the <code>*.deb</code> file navigate to where you downloaded the file and then enter the following command with root permission</p>
+<div class="cell">
+<div class="sourceCode" id="cb4"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install ./rstudio-2022.07.2-576-amd64.deb</span></code></pre></div>
+</div>
+<p>You can then start RStudio from the Console by simply typing</p>
+<div class="cell">
+<div class="sourceCode" id="cb5"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">rstudio</span></span></code></pre></div>
+</div>
+<p>or you can create a shortcut on you Desktop for easy startup.</p>
+</section>
+</section>
+</section>
+<section id="help" class="level3" data-number="1.1.2">
+<h3 data-number="1.1.2"><span class="header-section-number">1.1.2</span> Help</h3>
+<p>The R help is very useful for the use of functions.</p>
+<div class="cell">
+<div class="sourceCode" id="cb6"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>?plot <span class="co">#displays the help page for the plot function</span></span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">help</span>(<span class="st">&quot;*&quot;</span>) <span class="co">#for unconventional characters</span></span></code></pre></div>
+</div>
+<p>Calling the help opens a page (the exact behavior depends on the operating system) with information and usage examples about the documented function(s) or operators.</p>
+</section>
+<section id="functions" class="level3" data-number="1.1.3">
+<h3 data-number="1.1.3"><span class="header-section-number">1.1.3</span> Functions</h3>
+<p>The basic syntax is:</p>
+<div class="cell">
+<div class="sourceCode" id="cb7"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>afunction <span class="ot">&lt;-</span> <span class="cf">function</span>(arg1, arg2){</span>
+<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>  arg1 <span class="sc">+</span> arg2</span>
+<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>}</span>
+<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="fu">afunction</span>(<span class="dv">10</span>, <span class="dv">5</span>)</span></code></pre></div>
+<div class="cell-output cell-output-stdout">
+<pre><code>[1] 15</code></pre>
+</div>
+</div>
+</section>
+</section>
+<section id="spatial-in-r-history-and-evolutions" class="level2" data-number="1.2">
+<h2 data-number="1.2"><span class="header-section-number">1.2</span> Spatial in R : History and evolutions</h2>
+<p>Historically, 4 packages make it possible to import, manipulate and transform spatial data:</p>
+<ul>
+<li>The package <code>rgdal</code> <span class="citation" data-cites="rgdal">(<a href="#ref-rgdal" role="doc-biblioref">Bivand, Keitt, and Rowlingson 2022</a>)</span> which is an interface between R and the <a href="http://www.gdal.org/">GDAL</a> <span class="citation" data-cites="GDAL">(<a href="#ref-GDAL" role="doc-biblioref">GDAL/OGR contributors, n.d.</a>)</span> and <a href="https://proj.org/">PROJ</a> <span class="citation" data-cites="PROJ">(<a href="#ref-PROJ" role="doc-biblioref">PROJ contributors 2021</a>)</span> libraries allow you to import and export spatial data (shapefiles for example) and also to manage cartographic projections<br />
+</li>
+<li>The package <code>sp</code> <span class="citation" data-cites="sp">(<a href="#ref-sp" role="doc-biblioref">E. J. Pebesma and Bivand 2005</a>)</span> provides class and methods for vector spatial data in R. It allows displaying background maps, inspectiong an attribute table etc.<br />
+</li>
+<li>The package <code>rgeos</code> <span class="citation" data-cites="rgeos">(<a href="#ref-rgeos" role="doc-biblioref">Bivand and Rundel 2021</a>)</span> gives access to the <a href="http://trac.osgeo.org/geos/">GEOS</a> spatial operations library and therefore makes classic GIS operations available: calculation of surfaces or perimeters, calculation of distances, spatial aggregations, buffer zones, intersections, etc.<br />
+</li>
+<li>The package <code>raster</code> <span class="citation" data-cites="raster">(<a href="#ref-raster" role="doc-biblioref">Hijmans 2022a</a>)</span> is dedicated to the import, manipulation and modeling of raster data.</li>
+</ul>
+<p>Today, the main developments concerning vector data have moved away from the old 3 (<code>sp</code>, <code>rgdal</code>, <code>rgeos</code>) to rely mainly on the package <code>sf</code> (<span class="citation" data-cites="sf">(<a href="#ref-sf" role="doc-biblioref">E. Pebesma 2018a</a>)</span>, <span class="citation" data-cites="pebesma2018">(<a href="#ref-pebesma2018" role="doc-biblioref">E. Pebesma 2018b</a>)</span>). In this manual we will rely exclusively on this package to manipulate vector data.</p>
+<p>The packages <code>stars</code> <span class="citation" data-cites="stars">(<a href="#ref-stars" role="doc-biblioref">E. Pebesma 2021</a>)</span> and <code>terra</code> <span class="citation" data-cites="terra">(<a href="#ref-terra" role="doc-biblioref">Hijmans 2022b</a>)</span> come to replace the package <code>raster</code> for processing raster data. We have chosen to use the package here <code>terra</code> for its proximity to the <code>raster</code>.</p>
+</section>
+<section id="the-package-sf" class="level2" data-number="1.3">
+<h2 data-number="1.3"><span class="header-section-number">1.3</span> The package <code>sf</code></h2>
+<p><img src="img/sf.gif" align="right" width="150"/> The package <code>sf</code> was released in late 2016 by Edzer Pebesma (also author of <code>sp</code>). Its goal is to combine the feature of <code>sp</code>, <code>rgeos</code> and <code>rgdal</code> in a single, more ergonomic package. This package offers simple objects (following the <a href="https://en.wikipedia.org/wiki/Simple_Features"><em>simple feature</em></a> standard) which are easier to manipulate. Particular attention has been paid to the compatibility of the package with the <em>pipe</em> syntax and the operators of the <code>tidyverse</code>.</p>
+<p><code>sf</code> directly uses the GDAL, GEOS and PROJ libraries.</p>
+<div class="quarto-figure quarto-figure-center">
+<figure>
+<p><img src="img/sf_deps.png" class="img-fluid" width="600" /></p>
+</figure>
+</div>
+<p><a href="https://r-spatial.org/r/2020/03/17/wkt.html">From r-spatial.org</a></p>
+<div class="callout-note callout callout-style-simple no-icon">
+<div class="callout-body d-flex">
+<div class="callout-icon-container">
+<i class='callout-icon no-icon'></i>
+</div>
+<div class="callout-body-container">
+<p>Website of package <code>sf</code> : <a href="https://r-spatial.github.io/sf/">Simple Features for R</a></p>
+</div>
+</div>
+</div>
+<p>Many of the spatial data available on the internet are in shapefile format, which can be opened in the following way</p>
+<div class="cell">
+<div class="sourceCode" id="cb9"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(sf)</span></code></pre></div>
+<div class="cell-output cell-output-stderr">
+<pre><code>Linking to GEOS 3.9.3, GDAL 3.5.2, PROJ 8.2.1; sf_use_s2() is TRUE</code></pre>
+</div>
+<div class="sourceCode" id="cb11"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>district <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">&quot;data_cambodia/district.shp&quot;</span>)</span></code></pre></div>
+<div class="cell-output cell-output-stdout">
+<pre class="code-out"><code>Reading layer `district&#39; from data source 
+  `C:\Users\UNiK\Documents\R_works\IRD\Rspatial\rspatial-for-onehealth\data_cambodia\district.shp&#39; 
+  using driver `ESRI Shapefile&#39;
+Simple feature collection with 197 features and 10 fields
+Geometry type: MULTIPOLYGON
+Dimension:     XY
+Bounding box:  xmin: 211534.7 ymin: 1149105 xmax: 784612.1 ymax: 1625495
+Projected CRS: WGS 84 / UTM zone 48N</code></pre>
+</div>
+</div>
+<div class="callout-important callout callout-style-default callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+Shapefile format limitations
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<p>For the multiple limitations of this format (multi-file, limited number of records…) we advise you to prefer another format such as the geopackage <code>*.gpkg</code>. All the good reasons not to use the shapefile are <a href="http://switchfromshapefile.org/">here</a>.</p>
+</div>
+</div>
+<p>A geopackage is a database, to load a layer, you must know its name</p>
+<div class="cell">
+<div class="sourceCode" id="cb13"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">st_layers</span>(<span class="st">&quot;data_cambodia/cambodia.gpkg&quot;</span>)</span></code></pre></div>
+<div class="cell-output cell-output-stdout">
+<pre class="code-out"><code>Driver: GPKG 
+Available layers:
+  layer_name     geometry_type features fields              crs_name
+1    country     Multi Polygon        1     10 WGS 84 / UTM zone 48N
+2   district     Multi Polygon      197     10 WGS 84 / UTM zone 48N
+3  education     Multi Polygon       25     19 WGS 84 / UTM zone 48N
+4   hospital             Point      956     13 WGS 84 / UTM zone 48N
+5      cases       Multi Point      972      2 WGS 84 / UTM zone 48N
+6       road Multi Line String        6      9 WGS 84 / UTM zone 48N</code></pre>
+</div>
+</div>
+<div class="cell">
+<div class="sourceCode" id="cb15"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>road <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">&quot;data_cambodia/cambodia.gpkg&quot;</span>, <span class="at">layer =</span> <span class="st">&quot;road&quot;</span>)</span></code></pre></div>
+<div class="cell-output cell-output-stdout">
+<pre class="code-out"><code>Reading layer `road&#39; from data source 
+  `C:\Users\UNiK\Documents\R_works\IRD\Rspatial\rspatial-for-onehealth\data_cambodia\cambodia.gpkg&#39; 
+  using driver `GPKG&#39;
+Simple feature collection with 6 features and 9 fields
+Geometry type: MULTILINESTRING
+Dimension:     XY
+Bounding box:  xmin: 212377 ymin: 1152214 xmax: 784654.7 ymax: 1625281
+Projected CRS: WGS 84 / UTM zone 48N</code></pre>
+</div>
+</div>
+<section id="format-of-spatial-objects-sf" class="level3" data-number="1.3.1">
+<h3 data-number="1.3.1"><span class="header-section-number">1.3.1</span> Format of spatial objects <code>sf</code></h3>
+<div class="quarto-figure quarto-figure-center">
+<figure>
+<p><img src="img/sf.png" class="img-fluid" width="600" /></p>
+</figure>
+</div>
+<p>Objects<code>sf</code> are objects in <code>data.frame</code> which one of the columns contains geometries. This column is the class of sfc (<em>simple feature column</em>) and each individual of the column is a sfg <em>(simple feature geometry)</em>. This format is very practical insofa as the data and the geometries are intrinsically linked in the same object.</p>
+<div class="callout-note callout callout-style-simple no-icon">
+<div class="callout-body d-flex">
+<div class="callout-icon-container">
+<i class='callout-icon no-icon'></i>
+</div>
+<div class="callout-body-container">
+<p>Thumbnail describing the simple feature format: <a href="https://r-spatial.github.io/sf/articles/sf1.html">Simple Features for R</a></p>
+</div>
+</div>
+</div>
+<div class="callout-tip callout callout-style-default callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+Tip
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<p>A benchmark of vector processing libraries is available <a href="https://github.com/kadyb/vector-benchmark">here</a>.</p>
+</div>
+</div>
+</section>
+</section>
+<section id="package-mapsf" class="level2" data-number="1.4">
+<h2 data-number="1.4"><span class="header-section-number">1.4</span> Package <code>mapsf</code></h2>
+<p>The free R software spatial ecosystem is rich, dynamic and mature and several packages allow to import, process and represent spatial data. The package <a href="https://CRAN.R-project.org/package=maps"><code>mapsf</code></a> <span class="citation" data-cites="mapsf">(<a href="#ref-mapsf" role="doc-biblioref">Giraud 2022</a>)</span> relies on this ecosystem to integrate the creation of quality thematic maps into processing chains with R.</p>
+<p>Other packages can be used to make thematic maps. The package <code>ggplot2</code> <span class="citation" data-cites="ggplot2">(<a href="#ref-ggplot2" role="doc-biblioref">Wickham 2016</a>)</span>, in association with the package <code>ggspatial</code> <span class="citation" data-cites="ggspatial">(<a href="#ref-ggspatial" role="doc-biblioref">Dunnington 2021</a>)</span>, allows for example to display spatial objects and to make simple thematic maps. The package <code>tmap</code> <span class="citation" data-cites="tmap">(<a href="#ref-tmap" role="doc-biblioref">Tennekes 2018</a>)</span> is dedicated to the creation of thematic maps, it uses a syntax close to that of <code>ggplot2</code> (sequence of instructions combined with the ‘+’ sign). Documentation and tutorials for using these two packages are readily available on the web.</p>
+<p>Here, we will mainly use the package <code>mapsf</code> whose functionalities are quite complete and the handling rather simple. In addition, the package is relatively light.</p>
+<p><img src="img/logo_mapsf.png" align="right" width="120"/></p>
+<p><code>mapsf</code> allows you to create most of the types of map usually used in statistical cartography (choropleth maps, typologies, proportional or graduated symbols, etc.). For each type of map, several parameters are used to customize the cartographic representation. These parameters are the same as those found in the usual GIS or cartography software (for example, the choice of discretizations and color palettes, the modification of the size of the symbols or the customization of the legends). Associated with the data representation functions, other functions are dedicated to cartographic dressing (themes or graphic charters, legends, scales, orientation arrows, title, credits, annotations, etc.), the creation of boxes or the exporting maps.<br />
+<code>mapsf</code> is the successor of <a href="http://riatelab.github.io/cartography/docs/"><code>cartography</code></a> <span class="citation" data-cites="cartography">(<a href="#ref-cartography" role="doc-biblioref">Giraud and Lambert 2016</a>)</span>, it offers the same main functionalities while being lighter and more ergonomic.</p>
+<p>To use this package several sources can be consulted:</p>
+<ul>
+<li><p>The package documentation accessible <a href="http://riatelab.github.io/mapsf/">on the internet</a> or directly in R (<code>?mapsf</code>),</p></li>
+<li><p>A <a href="https://raw.githubusercontent.com/riatelab/mapsf/master/vignettes/web_only/img/mapsf_cheatsheet.pdf"><em>cheat sheet</em></a>,</p></li>
+</ul>
+<div class="quarto-figure quarto-figure-center">
+<figure>
+<p><img src="img/mapsf_cheatsheet.png" class="img-fluid" width="600" /></p>
+</figure>
+</div>
+<ul>
+<li><p>The <a href="https://riatelab.github.io/mapsf/articles/">vignettes</a> associated with the package show sample scripts,</p></li>
+<li><p>The <a href="https://rgeomatic.hypotheses.org/">R Geomatics</a> blog which provides resources and examples related to the package and more generally to the R spatial ecosystem.</p></li>
+</ul>
+</section>
+<section id="the-package-terra" class="level2" data-number="1.5">
+<h2 data-number="1.5"><span class="header-section-number">1.5</span> The package <code>terra</code></h2>
+<p><img src="img/logo_terra.png" align="right" width="150"/> The package <code>terra</code> was release in early 2020 by Robert J. Hijmans (also author of <code>raster</code>). Its objective is to propose methods of treatment and analysis of raster data. This package is very similar to the package <code>raster</code>; but it has more features, it’s easier to use, and it’s faster.</p>
+<div class="callout-note callout callout-style-simple no-icon">
+<div class="callout-body d-flex">
+<div class="callout-icon-container">
+<i class='callout-icon no-icon'></i>
+</div>
+<div class="callout-body-container">
+<p>Website of package <code>terra</code> : <a href="https://rspatial.org/terra/">Spatial Data Science with R and “terra”</a></p>
+</div>
+</div>
+</div>
+<div class="callout-tip callout callout-style-default callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+Tip
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<p>A benchmark of raster processing libraries is available <a href="https://github.com/kadyb/raster-benchmark">here</a>.</p>
+</div>
+</div>
+<div id="quarto-navigation-envelope" class="hidden">
+<p><span class="hidden" data-render-id="quarto-int-sidebar-title">Mapping and spatial analyses in R for One Health studies</span> <span class="hidden" data-render-id="quarto-int-navbar-title">Mapping and spatial analyses in R for One Health studies</span> <span class="hidden" data-render-id="quarto-int-next"><span class="chapter-number">2</span>  <span class="chapter-title">Data Acquisition</span></span> <span class="hidden" data-render-id="quarto-int-prev">Preface</span> <span class="hidden" data-render-id="quarto-int-sidebar:/index.html">Preface</span> <span class="hidden" data-render-id="quarto-int-sidebar:/01-introduction.html"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/02-data_acquisition.html"><span class="chapter-number">2</span>  <span class="chapter-title">Data Acquisition</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/03-vector_data.html"><span class="chapter-number">3</span>  <span class="chapter-title">Using vector data</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/04-raster_data.html"><span class="chapter-number">4</span>  <span class="chapter-title">Using raster data</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/05-mapping_with_r.html"><span class="chapter-number">5</span>  <span class="chapter-title">Mapping With R</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/07-basic_statistics.html"><span class="chapter-number">6</span>  <span class="chapter-title">Basic statistics for spatial analysis</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/references.html">References</span> <span class="hidden" data-render-id="footer-left">UMR 228 ESPACE-DEV</span> <span class="hidden" data-render-id="footer-right"><img src="img/ird_footer.png" height="50" /></span></p>
+</div>
+<div id="quarto-meta-markdown" class="hidden">
+<p><span class="hidden" data-render-id="quarto-metatitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-twittercardtitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-ogcardtitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-metasitename">Mapping and spatial analyses in R for One Health studies</span></p>
+</div>
+<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">
+<div id="ref-rgdal" class="csl-entry" role="doc-biblioentry">
+Bivand, Roger, Tim Keitt, and Barry Rowlingson. 2022. <span>“Rgdal: Bindings for the ’Geospatial’ Data Abstraction Library.”</span> <a href="https://CRAN.R-project.org/package=rgdal">https://CRAN.R-project.org/package=rgdal</a>.
+</div>
+<div id="ref-rgeos" class="csl-entry" role="doc-biblioentry">
+Bivand, Roger, and Colin Rundel. 2021. <span>“Rgeos: Interface to Geometry Engine - Open Source (’GEOS’).”</span> <a href="https://CRAN.R-project.org/package=rgeos">https://CRAN.R-project.org/package=rgeos</a>.
+</div>
+<div id="ref-ggspatial" class="csl-entry" role="doc-biblioentry">
+Dunnington, Dewey. 2021. <span>“Ggspatial: Spatial Data Framework for Ggplot2.”</span> <a href="https://CRAN.R-project.org/package=ggspatial">https://CRAN.R-project.org/package=ggspatial</a>.
+</div>
+<div id="ref-GDAL" class="csl-entry" role="doc-biblioentry">
+GDAL/OGR contributors. n.d. <em><span>GDAL/OGR</span> Geospatial Data Abstraction Software Library</em>. Open Source Geospatial Foundation. <a href="https://gdal.org">https://gdal.org</a>.
+</div>
+<div id="ref-mapsf" class="csl-entry" role="doc-biblioentry">
+Giraud, Timothée. 2022. <span>“Mapsf: Thematic Cartography.”</span> <a href="https://CRAN.R-project.org/package=mapsf">https://CRAN.R-project.org/package=mapsf</a>.
+</div>
+<div id="ref-cartography" class="csl-entry" role="doc-biblioentry">
+Giraud, Timothée, and Nicolas Lambert. 2016. <span>“Cartography: Create and Integrate Maps in Your r Workflow”</span> 1. <a href="https://doi.org/10.21105/joss.00054">https://doi.org/10.21105/joss.00054</a>.
+</div>
+<div id="ref-raster" class="csl-entry" role="doc-biblioentry">
+Hijmans, Robert J. 2022a. <span>“Raster: Geographic Data Analysis and Modeling.”</span> <a href="https://CRAN.R-project.org/package=raster">https://CRAN.R-project.org/package=raster</a>.
+</div>
+<div id="ref-terra" class="csl-entry" role="doc-biblioentry">
+———. 2022b. <span>“Terra: Spatial Data Analysis.”</span> <a href="https://CRAN.R-project.org/package=terra">https://CRAN.R-project.org/package=terra</a>.
+</div>
+<div id="ref-sf" class="csl-entry" role="doc-biblioentry">
+Pebesma, Edzer. 2018a. <span>“<span></span>Simple Features for r: Standardized Support for Spatial Vector Data<span></span>”</span> 10. <a href="https://doi.org/10.32614/RJ-2018-009">https://doi.org/10.32614/RJ-2018-009</a>.
+</div>
+<div id="ref-pebesma2018" class="csl-entry" role="doc-biblioentry">
+———. 2018b. <span>“Simple Features for R: Standardized Support for Spatial Vector Data.”</span> <em>The R Journal</em> 10 (1): 439. <a href="https://doi.org/10.32614/rj-2018-009">https://doi.org/10.32614/rj-2018-009</a>.
+</div>
+<div id="ref-stars" class="csl-entry" role="doc-biblioentry">
+———. 2021. <span>“Stars: Spatiotemporal Arrays, Raster and Vector Data Cubes.”</span> <a href="https://CRAN.R-project.org/package=stars">https://CRAN.R-project.org/package=stars</a>.
+</div>
+<div id="ref-sp" class="csl-entry" role="doc-biblioentry">
+Pebesma, Edzer J., and Roger S. Bivand. 2005. <span>“Classes and Methods for Spatial Data in <span></span>r<span></span>”</span> 5. <a href="https://CRAN.R-project.org/doc/Rnews/">https://CRAN.R-project.org/doc/Rnews/</a>.
+</div>
+<div id="ref-PROJ" class="csl-entry" role="doc-biblioentry">
+PROJ contributors. 2021. <em><span>PROJ</span> Coordinate Transformation Software Library</em>. Open Source Geospatial Foundation. <a href="https://proj.org/">https://proj.org/</a>.
+</div>
+<div id="ref-tmap" class="csl-entry" role="doc-biblioentry">
+Tennekes, Martijn. 2018. <span>“<span></span>Tmap<span></span>: Thematic Maps in <span></span>r<span></span>”</span> 84. <a href="https://doi.org/10.18637/jss.v084.i06">https://doi.org/10.18637/jss.v084.i06</a>.
+</div>
+<div id="ref-ggplot2" class="csl-entry" role="doc-biblioentry">
+Wickham, Hadley. 2016. <span>“Ggplot2: Elegant Graphics for Data Analysis.”</span> <a href="https://ggplot2.tidyverse.org">https://ggplot2.tidyverse.org</a>.
+</div>
+</div>
+</section>
+
+</main> <!-- /main -->
+<script id = "quarto-html-after-body" type="application/javascript">
+window.document.addEventListener("DOMContentLoaded", function (event) {
+  const toggleBodyColorMode = (bsSheetEl) => {
+    const mode = bsSheetEl.getAttribute("data-mode");
+    const bodyEl = window.document.querySelector("body");
+    if (mode === "dark") {
+      bodyEl.classList.add("quarto-dark");
+      bodyEl.classList.remove("quarto-light");
+    } else {
+      bodyEl.classList.add("quarto-light");
+      bodyEl.classList.remove("quarto-dark");
+    }
+  }
+  const toggleBodyColorPrimary = () => {
+    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
+    if (bsSheetEl) {
+      toggleBodyColorMode(bsSheetEl);
+    }
+  }
+  toggleBodyColorPrimary();  
+  const icon = "";
+  const anchorJS = new window.AnchorJS();
+  anchorJS.options = {
+    placement: 'right',
+    icon: icon
+  };
+  anchorJS.add('.anchored');
+  const clipboard = new window.ClipboardJS('.code-copy-button', {
+    target: function(trigger) {
+      return trigger.previousElementSibling;
+    }
+  });
+  clipboard.on('success', function(e) {
+    // button target
+    const button = e.trigger;
+    // don't keep focus
+    button.blur();
+    // flash "checked"
+    button.classList.add('code-copy-button-checked');
+    var currentTitle = button.getAttribute("title");
+    button.setAttribute("title", "Copied!");
+    setTimeout(function() {
+      button.setAttribute("title", currentTitle);
+      button.classList.remove('code-copy-button-checked');
+    }, 1000);
+    // clear code selection
+    e.clearSelection();
+  });
+  function tippyHover(el, contentFn) {
+    const config = {
+      allowHTML: true,
+      content: contentFn,
+      maxWidth: 500,
+      delay: 100,
+      arrow: false,
+      appendTo: function(el) {
+          return el.parentElement;
+      },
+      interactive: true,
+      interactiveBorder: 10,
+      theme: 'quarto',
+      placement: 'bottom-start'
+    };
+    window.tippy(el, config); 
+  }
+  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
+  for (var i=0; i<noterefs.length; i++) {
+    const ref = noterefs[i];
+    tippyHover(ref, function() {
+      // use id or data attribute instead here
+      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
+      try { href = new URL(href).hash; } catch {}
+      const id = href.replace(/^#\/?/, "");
+      const note = window.document.getElementById(id);
+      return note.innerHTML;
+    });
+  }
+  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
+  for (var i=0; i<bibliorefs.length; i++) {
+    const ref = bibliorefs[i];
+    const cites = ref.parentNode.getAttribute('data-cites').split(' ');
+    tippyHover(ref, function() {
+      var popup = window.document.createElement('div');
+      cites.forEach(function(cite) {
+        var citeDiv = window.document.createElement('div');
+        citeDiv.classList.add('hanging-indent');
+        citeDiv.classList.add('csl-entry');
+        var biblioDiv = window.document.getElementById('ref-' + cite);
+        if (biblioDiv) {
+          citeDiv.innerHTML = biblioDiv.innerHTML;
+        }
+        popup.appendChild(citeDiv);
+      });
+      return popup.innerHTML;
+    });
+  }
+    var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
+      var filterRegex = new RegExp('/' + window.location.host + '/');
+    var isInternal = (href) => {
+        return filterRegex.test(href) || localhostRegex.test(href);
+    }
+    // Inspect non-navigation links and adorn them if external
+    var links = window.document.querySelectorAll('a:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external)');
+    for (var i=0; i<links.length; i++) {
+      const link = links[i];
+      if (!isInternal(link.href)) {
+          // target, if specified
+          link.setAttribute("target", "_blank");
+      }
+    }
+});
+</script>
+<nav class="page-navigation">
+  <div class="nav-page nav-page-previous">
+      <a  href="/index.html" class="pagination-link">
+        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Preface</span>
+      </a>          
+  </div>
+  <div class="nav-page nav-page-next">
+      <a  href="/02-data_acquisition.html" class="pagination-link">
+        <span class="nav-page-text"><span class='chapter-number'>2</span>  <span class='chapter-title'>Data Acquisition</span></span> <i class="bi bi-arrow-right-short"></i>
+      </a>
+  </div>
+</nav>
+</div> <!-- /content -->
+<footer class="footer">
+  <div class="nav-footer">
+    <div class="nav-footer-left">
+      <div class='footer-contents'>UMR 228 ESPACE-DEV</div>  
+    </div>   
+    <div class="nav-footer-right">
+      <div class='footer-contents'>![](img/ird_footer.png){height="50"}
+</div>  
+    </div>
+  </div>
+</footer>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/01-introduction.qmd b/01-introduction.qmd
index 082553615a9c7a2e5992b23d2760be47f887f32d..04abe3b504206f1b3be77bb6834ec2b81ab5bc21 100644
--- a/01-introduction.qmd
+++ b/01-introduction.qmd
@@ -6,6 +6,20 @@ bibliography: references.bib
 
 ## Use of R
 
+::: callout-importan
+## REMINDER : R TIPS
+
+1.  Comment your code ! (`# important informations on the code`)
+
+2.  Check your R objects ! (`plot()`, `print()`, `View()` , ...)
+
+3.  Listen to R outputs ! (Errors AND Warnings)
+
+4.  Get help ! (`?name_of_function`, internet, others users)
+
+5.  Keep calm and take a break !
+:::
+
 ### Installation
 
 ::: callout-note
diff --git a/07-basic_statistics.qmd b/07-basic_statistics.qmd
index 7f9a9ab1c128aac68a5b795fbb0309cd75a9c5c6..7f692595afe4ef1ea1c2e19bd29419979394feb0 100644
--- a/07-basic_statistics.qmd
+++ b/07-basic_statistics.qmd
@@ -207,6 +207,8 @@ We will compute the Moran's statistics using `spdep`[@spdep] and `Dcluster`[@DCl
 library(spdep) # Functions for creating spatial weight, spatial analysis
 library(DCluster)  # Package with functions for spatial cluster analysis
 
+set.seed(345) # remove random sampling for reproducibility
+
 queen_nb <- poly2nb(district) # Neighbors according to queen case
 q_listw <- nb2listw(queen_nb, style = 'W') # row-standardized weights
 
@@ -502,5 +504,7 @@ mf_layout(title = "Cluster using kulldorf scan statistic")
 
 Both methods identified significant clusters. The two methods could identify a cluster around Phnom Penh after standardization for population counts. However, the identified clusters does not rely on the same assumption. While the Moran's test wonder whether their is any autocorrelation between clusters (i.e. second order effects of infection), the Kulldorff scan statistics wonder whether their is any heterogeneity in the case distribution. None of these test can inform on the infection processes (first or second order) for the studied disease and previous knowledge on the disease will help selecting the most accurate test. 
 
-
+::: callout-tip
+In this example, Cambodia is treated as an island, i.e. there is no data outside of its borders. In reality, some clusters can occurs across country's borders. You should be aware that such district will likely not be detected by these analysis. This border effect is still a hot topic in spatial studies and there is no conventional ways to deal with it. You can find in the literature some suggestion on how to deals with these border effect as assigning weights, or extrapolating data.
+:::
 
diff --git a/public/01-introduction.html b/public/01-introduction.html
index a129197926a43f9968e9899a97782541db33eee8..fb06b554865f34795a31ce9069a148e665314106 100644
--- a/public/01-introduction.html
+++ b/public/01-introduction.html
@@ -1,13 +1,15 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 
-<meta charset="utf-8">
-<meta name="generator" content="quarto-1.1.251">
+<head>
 
-<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
+<meta charset="utf-8" />
+<meta name="generator" content="quarto-1.1.189" />
 
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
 
-<title>Mapping and spatial analyses in R for One Health studies - 1&nbsp; Introduction</title>
+
+<title>Mapping and spatial analyses in R for One Health studies – 1  Introduction</title>
 <style>
 code{white-space: pre-wrap;}
 span.smallcaps{font-variant: small-caps;}
@@ -104,25 +106,7 @@ div.csl-indent {
 }
 </style>
 
-
-<script src="site_libs/quarto-nav/quarto-nav.js"></script>
-<script src="site_libs/quarto-nav/headroom.min.js"></script>
-<script src="site_libs/clipboard/clipboard.min.js"></script>
-<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
-<script src="site_libs/quarto-search/fuse.min.js"></script>
-<script src="site_libs/quarto-search/quarto-search.js"></script>
-<meta name="quarto:offset" content="./">
-<link href="./02-data_acquisition.html" rel="next">
-<link href="./index.html" rel="prev">
-<script src="site_libs/quarto-html/quarto.js"></script>
-<script src="site_libs/quarto-html/popper.min.js"></script>
-<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
-<script src="site_libs/quarto-html/anchor.min.js"></script>
-<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
-<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
-<script src="site_libs/bootstrap/bootstrap.min.js"></script>
-<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
-<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
+<!-- htmldependencies:E3FAD763 -->
 <script id="quarto-search-options" type="application/json">{
   "location": "sidebar",
   "copy-button": false,
@@ -145,17 +129,22 @@ div.csl-indent {
 <style>html{ scroll-behavior: smooth; }</style>
 
 
-<link rel="stylesheet" href="styles.css">
+<link rel="stylesheet" href="styles.css" />
 </head>
 
-<body class="nav-sidebar floating">
+<body>
 
 <div id="quarto-search-results"></div>
   <header id="quarto-header" class="headroom fixed-top">
-  <nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
+  <nav class="quarto-secondary-nav" 
+        data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" 
+        aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation"
+        onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"
+  >
     <div class="container-fluid d-flex justify-content-between">
-      <h1 class="quarto-secondary-nav-title"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Introduction</span></h1>
-      <button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
+      <h1 class="quarto-secondary-nav-title"></h1>
+      <button type="button" 
+        class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
         <i class="bi bi-chevron-right"></i>
       </button>
     </div>
@@ -167,7 +156,9 @@ div.csl-indent {
   <nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto">
     <div class="pt-lg-2 mt-2 text-left sidebar-header">
     <div class="sidebar-title mb-0 py-0">
-      <a href="./">Mapping and spatial analyses in R for One Health studies</a> 
+      <a href="/">
+      Mapping and spatial analyses in R for One Health studies
+      </a> 
         <div class="sidebar-tools-main">
     <a href="https://forge.ird.fr/espace-dev/personnels/longour/geohealth/documentation/rspatial-for-onehealth" title="Source Code" class="sidebar-tool px-1"><i class="bi bi-git"></i></a>
 </div>
@@ -182,42 +173,42 @@ div.csl-indent {
     <ul class="list-unstyled mt-1">
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./index.html" class="sidebar-item-text sidebar-link">Preface</a>
+  <a href="/index.html" class="sidebar-item-text sidebar-link">Preface</a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./01-introduction.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Introduction</span></a>
+  <a href="/01-introduction.html" class="sidebar-item-text sidebar-link active"><span class='chapter-number'>1</span>  <span class='chapter-title'>Introduction</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./02-data_acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Data Acquisition</span></a>
+  <a href="/02-data_acquisition.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>2</span>  <span class='chapter-title'>Data Acquisition</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./03-vector_data.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Using vector data</span></a>
+  <a href="/03-vector_data.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>3</span>  <span class='chapter-title'>Using vector data</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./04-raster_data.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Using raster data</span></a>
+  <a href="/04-raster_data.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>4</span>  <span class='chapter-title'>Using raster data</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./05-mapping_with_r.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Mapping With R</span></a>
+  <a href="/05-mapping_with_r.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>5</span>  <span class='chapter-title'>Mapping With R</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./07-basic_statistics.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Basic statistics for spatial analysis</span></a>
+  <a href="/07-basic_statistics.html" class="sidebar-item-text sidebar-link"><span class='chapter-number'>6</span>  <span class='chapter-title'>Basic statistics for spatial analysis</span></a>
   </div>
 </li>
         <li class="sidebar-item">
   <div class="sidebar-item-container"> 
-  <a href="./references.html" class="sidebar-item-text sidebar-link">References</a>
+  <a href="/references.html" class="sidebar-item-text sidebar-link">References</a>
   </div>
 </li>
     </ul>
@@ -225,36 +216,14 @@ div.csl-indent {
 </nav>
 <!-- margin-sidebar -->
     <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
-        <nav id="TOC" role="doc-toc" class="toc-active">
-    <h2 id="toc-title">Table of contents</h2>
-   
-  <ul>
-  <li><a href="#use-of-r" id="toc-use-of-r" class="nav-link active" data-scroll-target="#use-of-r"><span class="toc-section-number">1.1</span>  Use of R</a>
-  <ul>
-  <li><a href="#installation" id="toc-installation" class="nav-link" data-scroll-target="#installation"><span class="toc-section-number">1.1.1</span>  Installation</a>
-  <ul class="collapse">
-  <li><a href="#r" id="toc-r" class="nav-link" data-scroll-target="#r"><span class="toc-section-number">1.1.1.1</span>  R</a></li>
-  <li><a href="#rstudio" id="toc-rstudio" class="nav-link" data-scroll-target="#rstudio"><span class="toc-section-number">1.1.1.2</span>  RStudio</a></li>
-  </ul></li>
-  <li><a href="#help" id="toc-help" class="nav-link" data-scroll-target="#help"><span class="toc-section-number">1.1.2</span>  Help</a></li>
-  <li><a href="#functions" id="toc-functions" class="nav-link" data-scroll-target="#functions"><span class="toc-section-number">1.1.3</span>  Functions</a></li>
-  </ul></li>
-  <li><a href="#spatial-in-r-history-and-evolutions" id="toc-spatial-in-r-history-and-evolutions" class="nav-link" data-scroll-target="#spatial-in-r-history-and-evolutions"><span class="toc-section-number">1.2</span>  Spatial in R : History and evolutions</a></li>
-  <li><a href="#the-package-sf" id="toc-the-package-sf" class="nav-link" data-scroll-target="#the-package-sf"><span class="toc-section-number">1.3</span>  The package <code>sf</code></a>
-  <ul>
-  <li><a href="#format-of-spatial-objects-sf" id="toc-format-of-spatial-objects-sf" class="nav-link" data-scroll-target="#format-of-spatial-objects-sf"><span class="toc-section-number">1.3.1</span>  Format of spatial objects <code>sf</code></a></li>
-  </ul></li>
-  <li><a href="#package-mapsf" id="toc-package-mapsf" class="nav-link" data-scroll-target="#package-mapsf"><span class="toc-section-number">1.4</span>  Package <code>mapsf</code></a></li>
-  <li><a href="#the-package-terra" id="toc-the-package-terra" class="nav-link" data-scroll-target="#the-package-terra"><span class="toc-section-number">1.5</span>  The package <code>terra</code></a></li>
-  </ul>
-</nav>
+        <div id="quarto-toc-target"></div>
     </div>
 <!-- main -->
 <main class="content" id="quarto-document-content">
 
 <header id="title-block-header" class="quarto-title-block default">
 <div class="quarto-title">
-<h1 class="title"><span id="introductionx" class="quarto-section-identifier d-none d-lg-block"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Introduction</span></span></h1>
+<h1 class="title"><span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></h1>
 </div>
 
 
@@ -267,15 +236,56 @@ div.csl-indent {
   
 
 </header>
-
+<nav id="TOC" role="doc-toc">
+    <h2 id="toc-title">Table of contents</h2>
+   
+  <ul>
+  <li><a href="#use-of-r" id="toc-use-of-r"><span class="toc-section-number">1.1</span> <span class="header-section-number">1.1</span> Use of R</a>
+  <ul>
+  <li><a href="#installation" id="toc-installation"><span class="toc-section-number">1.1.1</span> <span class="header-section-number">1.1.1</span> Installation</a>
+  <ul>
+  <li><a href="#r" id="toc-r"><span class="toc-section-number">1.1.1.1</span> <span class="header-section-number">1.1.1.1</span> R</a></li>
+  <li><a href="#rstudio" id="toc-rstudio"><span class="toc-section-number">1.1.1.2</span> <span class="header-section-number">1.1.1.2</span> RStudio</a></li>
+  </ul></li>
+  <li><a href="#help" id="toc-help"><span class="toc-section-number">1.1.2</span> <span class="header-section-number">1.1.2</span> Help</a></li>
+  <li><a href="#functions" id="toc-functions"><span class="toc-section-number">1.1.3</span> <span class="header-section-number">1.1.3</span> Functions</a></li>
+  </ul></li>
+  <li><a href="#spatial-in-r-history-and-evolutions" id="toc-spatial-in-r-history-and-evolutions"><span class="toc-section-number">1.2</span> <span class="header-section-number">1.2</span> Spatial in R : History and evolutions</a></li>
+  <li><a href="#the-package-sf" id="toc-the-package-sf"><span class="toc-section-number">1.3</span> <span class="header-section-number">1.3</span> The package <code>sf</code></a>
+  <ul>
+  <li><a href="#format-of-spatial-objects-sf" id="toc-format-of-spatial-objects-sf"><span class="toc-section-number">1.3.1</span> <span class="header-section-number">1.3.1</span> Format of spatial objects <code>sf</code></a></li>
+  </ul></li>
+  <li><a href="#package-mapsf" id="toc-package-mapsf"><span class="toc-section-number">1.4</span> <span class="header-section-number">1.4</span> Package <code>mapsf</code></a></li>
+  <li><a href="#the-package-terra" id="toc-the-package-terra"><span class="toc-section-number">1.5</span> <span class="header-section-number">1.5</span> The package <code>terra</code></a></li>
+  </ul>
+</nav>
 <section id="use-of-r" class="level2" data-number="1.1">
-<h2 data-number="1.1" class="anchored" data-anchor-id="use-of-r"><span class="header-section-number">1.1</span> Use of R</h2>
+<h2 data-number="1.1"><span class="header-section-number">1.1</span> Use of R</h2>
+<div class="callout-importan callout callout-style-default no-icon callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class='callout-icon no-icon'></i>
+</div>
+<div class="callout-caption-container flex-fill">
+REMINDER : R TIPS
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<ol type="1">
+<li><p>Comment your code ! (<code># important informations on the code</code>)</p></li>
+<li><p>Check your R objects ! (<code>plot()</code>, <code>print()</code>, <code>View()</code> , …)</p></li>
+<li><p>Listen to R outputs ! (Errors AND Warnings)</p></li>
+<li><p>Get help ! (<code>?name_of_function</code>, internet, others users)</p></li>
+<li><p>Keep calm and take a break !</p></li>
+</ol>
+</div>
+</div>
 <section id="installation" class="level3" data-number="1.1.1">
-<h3 data-number="1.1.1" class="anchored" data-anchor-id="installation"><span class="header-section-number">1.1.1</span> Installation</h3>
+<h3 data-number="1.1.1"><span class="header-section-number">1.1.1</span> Installation</h3>
 <div class="callout-note callout callout-style-default callout-captioned">
 <div class="callout-header d-flex align-content-center">
 <div class="callout-icon-container">
-<i class="callout-icon"></i>
+<i class='callout-icon'></i>
 </div>
 <div class="callout-caption-container flex-fill">
 Note
@@ -286,78 +296,78 @@ Note
 </div>
 </div>
 <section id="r" class="level4" data-number="1.1.1.1">
-<h4 data-number="1.1.1.1" class="anchored" data-anchor-id="r"><span class="header-section-number">1.1.1.1</span> R</h4>
+<h4 data-number="1.1.1.1"><span class="header-section-number">1.1.1.1</span> R</h4>
 <section id="windows-users" class="level5" data-number="1.1.1.1.1">
-<h5 data-number="1.1.1.1.1" class="anchored" data-anchor-id="windows-users"><span class="header-section-number">1.1.1.1.1</span> Windows users</h5>
+<h5 data-number="1.1.1.1.1"><span class="header-section-number">1.1.1.1.1</span> Windows users</h5>
 <p>For Windows users select the ‘<a href="(https://cran.r-project.org/bin/windows/)">Download R for Windows</a>’ link and then click on the ‘base’ link and finally the download link ‘Download R 4.2.1 for Windows’. This will begin the download of the ‘.exe’ installation file. When the download has completed double click on the R executable file and follow the on-screen instructions. Full installation instructions can be found at the <a href="https://cran.r-project.org/bin/windows/">CRAN website</a>.</p>
 </section>
 <section id="mac-users" class="level5" data-number="1.1.1.1.2">
-<h5 data-number="1.1.1.1.2" class="anchored" data-anchor-id="mac-users"><span class="header-section-number">1.1.1.1.2</span> Mac users</h5>
+<h5 data-number="1.1.1.1.2"><span class="header-section-number">1.1.1.1.2</span> Mac users</h5>
 <p>For Mac users select the ‘<a href="https://cran.r-project.org/bin/macosx/">Download R for (Mac) OS X</a>’ link. The binary can be downloaded by selecting the ‘R-4.2.1.pkg’. Once downloaded, double click on the file icon and follow the on-screen instructions to guide you through the necessary steps. See the ‘<a href="https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html">R for Mac OS X FAQ</a>’ for further information on installation.</p>
 </section>
 <section id="linux-users" class="level5" data-number="1.1.1.1.3">
-<h5 data-number="1.1.1.1.3" class="anchored" data-anchor-id="linux-users"><span class="header-section-number">1.1.1.1.3</span> Linux users</h5>
+<h5 data-number="1.1.1.1.3"><span class="header-section-number">1.1.1.1.3</span> Linux users</h5>
 <p>For Linux users, the installation method will depend on which flavour of Linux you are using. There are reasonably comprehensive instruction <a href="https://cran.r-project.org/bin/linux/">here</a> for Debian, Redhat, Suse and Ubuntu. In most cases you can just use your OS package manager to install R from the official repository. On Ubuntu fire up a shell (Terminal) and use (you will need root permission to do this):</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt update</span>
-<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install r-base r-base-dev</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt update</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install r-base r-base-dev</span></code></pre></div>
 </div>
 <p>which will install base R and also the development version of base R (you only need this if you want to compile R packages from source but it doesn’t hurt to have it).</p>
 <p>If you receive an error after running the code above you may need to add a ‘source.list’ entry to your etc/apt/sources.list file. To do this open the terminal and enter this:</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> <span class="at">--no-install-recommends</span> software-properties-common dirmngr</span>
+<div class="sourceCode" id="cb2"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> <span class="at">--no-install-recommends</span> software-properties-common dirmngr</span>
 <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Add keys</span></span>
 <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">wget</span> <span class="at">-qO-</span> https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc <span class="kw">|</span> <span class="fu">sudo</span> tee <span class="at">-a</span> /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc</span>
 <span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
-<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> add-apt-repository <span class="st">"deb https://cloud.r-project.org/bin/linux/ubuntu </span><span class="va">$(</span><span class="ex">lsb_release</span> <span class="at">-cs</span><span class="va">)</span><span class="st">-cran40/"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> add-apt-repository <span class="st">&quot;deb https://cloud.r-project.org/bin/linux/ubuntu </span><span class="va">$(</span><span class="ex">lsb_release</span> <span class="at">-cs</span><span class="va">)</span><span class="st">-cran40/&quot;</span></span></code></pre></div>
 </div>
 <p>Once you have done this then re-run the apt commands above and you should be good to go.</p>
 <p>Install the following packages to allow for future spatial data analysis:</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> libgdal-dev libproj-dev libgeos-dev libudunits2-dev libv8-dev libnode-dev libcairo2-dev libnetcdf-dev</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb3"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install <span class="at">-y</span> libgdal-dev libproj-dev libgeos-dev libudunits2-dev libv8-dev libnode-dev libcairo2-dev libnetcdf-dev</span></code></pre></div>
 </div>
 </section>
 </section>
 <section id="rstudio" class="level4" data-number="1.1.1.2">
-<h4 data-number="1.1.1.2" class="anchored" data-anchor-id="rstudio"><span class="header-section-number">1.1.1.2</span> RStudio</h4>
+<h4 data-number="1.1.1.2"><span class="header-section-number">1.1.1.2</span> RStudio</h4>
 <p>Whilst its eminently possible to just use the base installation of R (many people do), we will be using a popular Integrated Development Environment (IDE) called RStudio. RStudio can be thought of as an add-on to R which provides a more user-friendly interface, incorporating the R Console, a script editor and other useful functionality (like R markdown and Git Hub integration). You can find more information about RStudio <a href="https://rstudio.com/">here</a>.</p>
 <p>RStudio is freely available for Windows, Mac and Linux operating systems and can be downloaded from the <a href="https://rstudio.com/products/rstudio/download">RStudio site</a>. You should select the ‘RStudio Desktop’ version. Note: you must install R before you install RStudio.</p>
 <section id="windows-and-mac-users" class="level5" data-number="1.1.1.2.1">
-<h5 data-number="1.1.1.2.1" class="anchored" data-anchor-id="windows-and-mac-users"><span class="header-section-number">1.1.1.2.1</span> Windows and Mac users</h5>
+<h5 data-number="1.1.1.2.1"><span class="header-section-number">1.1.1.2.1</span> Windows and Mac users</h5>
 <p>For Windows and Mac users you should be presented with the appropriate link for downloading. Click on this link and once downloaded run the installer and follow the instructions. If you don’t see the link then scroll down to the ‘All Installers’ section and choose the link manually.</p>
 </section>
 <section id="linux-users-1" class="level5" data-number="1.1.1.2.2">
-<h5 data-number="1.1.1.2.2" class="anchored" data-anchor-id="linux-users-1"><span class="header-section-number">1.1.1.2.2</span> Linux users</h5>
+<h5 data-number="1.1.1.2.2"><span class="header-section-number">1.1.1.2.2</span> Linux users</h5>
 <p>For Linux users scroll down to the ‘All Installers’ section and choose the appropriate link to download the binary for your Linux operating system. RStudio for Ubuntu (and Debian) is available as a <code>*.deb</code> package.</p>
 <p>To install the <code>*.deb</code> file navigate to where you downloaded the file and then enter the following command with root permission</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install ./rstudio-2022.07.2-576-amd64.deb</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb4"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install ./rstudio-2022.07.2-576-amd64.deb</span></code></pre></div>
 </div>
 <p>You can then start RStudio from the Console by simply typing</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">rstudio</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb5"><pre class="sourceCode bash cell-code"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">rstudio</span></span></code></pre></div>
 </div>
 <p>or you can create a shortcut on you Desktop for easy startup.</p>
 </section>
 </section>
 </section>
 <section id="help" class="level3" data-number="1.1.2">
-<h3 data-number="1.1.2" class="anchored" data-anchor-id="help"><span class="header-section-number">1.1.2</span> Help</h3>
+<h3 data-number="1.1.2"><span class="header-section-number">1.1.2</span> Help</h3>
 <p>The R help is very useful for the use of functions.</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>?plot <span class="co">#displays the help page for the plot function</span></span>
-<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">help</span>(<span class="st">"*"</span>) <span class="co">#for unconventional characters</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb6"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>?plot <span class="co">#displays the help page for the plot function</span></span>
+<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">help</span>(<span class="st">&quot;*&quot;</span>) <span class="co">#for unconventional characters</span></span></code></pre></div>
 </div>
 <p>Calling the help opens a page (the exact behavior depends on the operating system) with information and usage examples about the documented function(s) or operators.</p>
 </section>
 <section id="functions" class="level3" data-number="1.1.3">
-<h3 data-number="1.1.3" class="anchored" data-anchor-id="functions"><span class="header-section-number">1.1.3</span> Functions</h3>
+<h3 data-number="1.1.3"><span class="header-section-number">1.1.3</span> Functions</h3>
 <p>The basic syntax is:</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>afunction <span class="ot">&lt;-</span> <span class="cf">function</span>(arg1, arg2){</span>
+<div class="sourceCode" id="cb7"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>afunction <span class="ot">&lt;-</span> <span class="cf">function</span>(arg1, arg2){</span>
 <span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>  arg1 <span class="sc">+</span> arg2</span>
 <span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>}</span>
-<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="fu">afunction</span>(<span class="dv">10</span>, <span class="dv">5</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="fu">afunction</span>(<span class="dv">10</span>, <span class="dv">5</span>)</span></code></pre></div>
 <div class="cell-output cell-output-stdout">
 <pre><code>[1] 15</code></pre>
 </div>
@@ -365,34 +375,34 @@ Note
 </section>
 </section>
 <section id="spatial-in-r-history-and-evolutions" class="level2" data-number="1.2">
-<h2 data-number="1.2" class="anchored" data-anchor-id="spatial-in-r-history-and-evolutions"><span class="header-section-number">1.2</span> Spatial in R : History and evolutions</h2>
+<h2 data-number="1.2"><span class="header-section-number">1.2</span> Spatial in R : History and evolutions</h2>
 <p>Historically, 4 packages make it possible to import, manipulate and transform spatial data:</p>
 <ul>
-<li>The package <code>rgdal</code> <span class="citation" data-cites="rgdal">(<a href="references.html#ref-rgdal" role="doc-biblioref">Bivand, Keitt, and Rowlingson 2022</a>)</span> which is an interface between R and the <a href="http://www.gdal.org/">GDAL</a> <span class="citation" data-cites="GDAL">(<a href="references.html#ref-GDAL" role="doc-biblioref">GDAL/OGR contributors, n.d.</a>)</span> and <a href="https://proj.org/">PROJ</a> <span class="citation" data-cites="PROJ">(<a href="references.html#ref-PROJ" role="doc-biblioref">PROJ contributors 2021</a>)</span> libraries allow you to import and export spatial data (shapefiles for example) and also to manage cartographic projections<br>
+<li>The package <code>rgdal</code> <span class="citation" data-cites="rgdal">(<a href="#ref-rgdal" role="doc-biblioref">Bivand, Keitt, and Rowlingson 2022</a>)</span> which is an interface between R and the <a href="http://www.gdal.org/">GDAL</a> <span class="citation" data-cites="GDAL">(<a href="#ref-GDAL" role="doc-biblioref">GDAL/OGR contributors, n.d.</a>)</span> and <a href="https://proj.org/">PROJ</a> <span class="citation" data-cites="PROJ">(<a href="#ref-PROJ" role="doc-biblioref">PROJ contributors 2021</a>)</span> libraries allow you to import and export spatial data (shapefiles for example) and also to manage cartographic projections<br />
 </li>
-<li>The package <code>sp</code> <span class="citation" data-cites="sp">(<a href="references.html#ref-sp" role="doc-biblioref">E. J. Pebesma and Bivand 2005</a>)</span> provides class and methods for vector spatial data in R. It allows displaying background maps, inspectiong an attribute table etc.<br>
+<li>The package <code>sp</code> <span class="citation" data-cites="sp">(<a href="#ref-sp" role="doc-biblioref">E. J. Pebesma and Bivand 2005</a>)</span> provides class and methods for vector spatial data in R. It allows displaying background maps, inspectiong an attribute table etc.<br />
 </li>
-<li>The package <code>rgeos</code> <span class="citation" data-cites="rgeos">(<a href="references.html#ref-rgeos" role="doc-biblioref">Bivand and Rundel 2021</a>)</span> gives access to the <a href="http://trac.osgeo.org/geos/">GEOS</a> spatial operations library and therefore makes classic GIS operations available: calculation of surfaces or perimeters, calculation of distances, spatial aggregations, buffer zones, intersections, etc.<br>
+<li>The package <code>rgeos</code> <span class="citation" data-cites="rgeos">(<a href="#ref-rgeos" role="doc-biblioref">Bivand and Rundel 2021</a>)</span> gives access to the <a href="http://trac.osgeo.org/geos/">GEOS</a> spatial operations library and therefore makes classic GIS operations available: calculation of surfaces or perimeters, calculation of distances, spatial aggregations, buffer zones, intersections, etc.<br />
 </li>
-<li>The package <code>raster</code> <span class="citation" data-cites="raster">(<a href="references.html#ref-raster" role="doc-biblioref">Hijmans 2022a</a>)</span> is dedicated to the import, manipulation and modeling of raster data.</li>
+<li>The package <code>raster</code> <span class="citation" data-cites="raster">(<a href="#ref-raster" role="doc-biblioref">Hijmans 2022a</a>)</span> is dedicated to the import, manipulation and modeling of raster data.</li>
 </ul>
-<p>Today, the main developments concerning vector data have moved away from the old 3 (<code>sp</code>, <code>rgdal</code>, <code>rgeos</code>) to rely mainly on the package <code>sf</code> (<span class="citation" data-cites="sf">(<a href="references.html#ref-sf" role="doc-biblioref">E. Pebesma 2018a</a>)</span>, <span class="citation" data-cites="pebesma2018">(<a href="references.html#ref-pebesma2018" role="doc-biblioref">E. Pebesma 2018b</a>)</span>). In this manual we will rely exclusively on this package to manipulate vector data.</p>
-<p>The packages <code>stars</code> <span class="citation" data-cites="stars">(<a href="references.html#ref-stars" role="doc-biblioref">E. Pebesma 2021</a>)</span> and <code>terra</code> <span class="citation" data-cites="terra">(<a href="references.html#ref-terra" role="doc-biblioref">Hijmans 2022b</a>)</span> come to replace the package <code>raster</code> for processing raster data. We have chosen to use the package here <code>terra</code> for its proximity to the <code>raster</code>.</p>
+<p>Today, the main developments concerning vector data have moved away from the old 3 (<code>sp</code>, <code>rgdal</code>, <code>rgeos</code>) to rely mainly on the package <code>sf</code> (<span class="citation" data-cites="sf">(<a href="#ref-sf" role="doc-biblioref">E. Pebesma 2018a</a>)</span>, <span class="citation" data-cites="pebesma2018">(<a href="#ref-pebesma2018" role="doc-biblioref">E. Pebesma 2018b</a>)</span>). In this manual we will rely exclusively on this package to manipulate vector data.</p>
+<p>The packages <code>stars</code> <span class="citation" data-cites="stars">(<a href="#ref-stars" role="doc-biblioref">E. Pebesma 2021</a>)</span> and <code>terra</code> <span class="citation" data-cites="terra">(<a href="#ref-terra" role="doc-biblioref">Hijmans 2022b</a>)</span> come to replace the package <code>raster</code> for processing raster data. We have chosen to use the package here <code>terra</code> for its proximity to the <code>raster</code>.</p>
 </section>
 <section id="the-package-sf" class="level2" data-number="1.3">
-<h2 data-number="1.3" class="anchored" data-anchor-id="the-package-sf"><span class="header-section-number">1.3</span> The package <code>sf</code></h2>
-<p><img src="img/sf.gif" align="right" width="150"> The package <code>sf</code> was released in late 2016 by Edzer Pebesma (also author of <code>sp</code>). Its goal is to combine the feature of <code>sp</code>, <code>rgeos</code> and <code>rgdal</code> in a single, more ergonomic package. This package offers simple objects (following the <a href="https://en.wikipedia.org/wiki/Simple_Features"><em>simple feature</em></a> standard) which are easier to manipulate. Particular attention has been paid to the compatibility of the package with the <em>pipe</em> syntax and the operators of the <code>tidyverse</code>.</p>
+<h2 data-number="1.3"><span class="header-section-number">1.3</span> The package <code>sf</code></h2>
+<p><img src="img/sf.gif" align="right" width="150"/> The package <code>sf</code> was released in late 2016 by Edzer Pebesma (also author of <code>sp</code>). Its goal is to combine the feature of <code>sp</code>, <code>rgeos</code> and <code>rgdal</code> in a single, more ergonomic package. This package offers simple objects (following the <a href="https://en.wikipedia.org/wiki/Simple_Features"><em>simple feature</em></a> standard) which are easier to manipulate. Particular attention has been paid to the compatibility of the package with the <em>pipe</em> syntax and the operators of the <code>tidyverse</code>.</p>
 <p><code>sf</code> directly uses the GDAL, GEOS and PROJ libraries.</p>
 <div class="quarto-figure quarto-figure-center">
-<figure class="figure">
-<p><img src="img/sf_deps.png" class="img-fluid figure-img" width="600"></p>
+<figure>
+<p><img src="img/sf_deps.png" class="img-fluid" width="600" /></p>
 </figure>
 </div>
 <p><a href="https://r-spatial.org/r/2020/03/17/wkt.html">From r-spatial.org</a></p>
 <div class="callout-note callout callout-style-simple no-icon">
 <div class="callout-body d-flex">
 <div class="callout-icon-container">
-<i class="callout-icon no-icon"></i>
+<i class='callout-icon no-icon'></i>
 </div>
 <div class="callout-body-container">
 <p>Website of package <code>sf</code> : <a href="https://r-spatial.github.io/sf/">Simple Features for R</a></p>
@@ -401,15 +411,15 @@ Note
 </div>
 <p>Many of the spatial data available on the internet are in shapefile format, which can be opened in the following way</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(sf)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb9"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(sf)</span></code></pre></div>
 <div class="cell-output cell-output-stderr">
-<pre><code>Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.1; sf_use_s2() is TRUE</code></pre>
+<pre><code>Linking to GEOS 3.9.3, GDAL 3.5.2, PROJ 8.2.1; sf_use_s2() is TRUE</code></pre>
 </div>
-<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>district <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">"data_cambodia/district.shp"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb11"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>district <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">&quot;data_cambodia/district.shp&quot;</span>)</span></code></pre></div>
 <div class="cell-output cell-output-stdout">
-<pre class="code-out"><code>Reading layer `district' from data source 
-  `/home/lucas/Documents/ForgeIRD/rspatial-for-onehealth/data_cambodia/district.shp' 
-  using driver `ESRI Shapefile'
+<pre class="code-out"><code>Reading layer `district&#39; from data source 
+  `C:\Users\UNiK\Documents\R_works\IRD\Rspatial\rspatial-for-onehealth\data_cambodia\district.shp&#39; 
+  using driver `ESRI Shapefile&#39;
 Simple feature collection with 197 features and 10 fields
 Geometry type: MULTIPOLYGON
 Dimension:     XY
@@ -420,7 +430,7 @@ Projected CRS: WGS 84 / UTM zone 48N</code></pre>
 <div class="callout-important callout callout-style-default callout-captioned">
 <div class="callout-header d-flex align-content-center">
 <div class="callout-icon-container">
-<i class="callout-icon"></i>
+<i class='callout-icon'></i>
 </div>
 <div class="callout-caption-container flex-fill">
 Shapefile format limitations
@@ -432,7 +442,7 @@ Shapefile format limitations
 </div>
 <p>A geopackage is a database, to load a layer, you must know its name</p>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">st_layers</span>(<span class="st">"data_cambodia/cambodia.gpkg"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb13"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">st_layers</span>(<span class="st">&quot;data_cambodia/cambodia.gpkg&quot;</span>)</span></code></pre></div>
 <div class="cell-output cell-output-stdout">
 <pre class="code-out"><code>Driver: GPKG 
 Available layers:
@@ -446,11 +456,11 @@ Available layers:
 </div>
 </div>
 <div class="cell">
-<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>road <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">"data_cambodia/cambodia.gpkg"</span>, <span class="at">layer =</span> <span class="st">"road"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<div class="sourceCode" id="cb15"><pre class="sourceCode r cell-code"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>road <span class="ot">&lt;-</span> <span class="fu">st_read</span>(<span class="st">&quot;data_cambodia/cambodia.gpkg&quot;</span>, <span class="at">layer =</span> <span class="st">&quot;road&quot;</span>)</span></code></pre></div>
 <div class="cell-output cell-output-stdout">
-<pre class="code-out"><code>Reading layer `road' from data source 
-  `/home/lucas/Documents/ForgeIRD/rspatial-for-onehealth/data_cambodia/cambodia.gpkg' 
-  using driver `GPKG'
+<pre class="code-out"><code>Reading layer `road&#39; from data source 
+  `C:\Users\UNiK\Documents\R_works\IRD\Rspatial\rspatial-for-onehealth\data_cambodia\cambodia.gpkg&#39; 
+  using driver `GPKG&#39;
 Simple feature collection with 6 features and 9 fields
 Geometry type: MULTILINESTRING
 Dimension:     XY
@@ -459,17 +469,17 @@ Projected CRS: WGS 84 / UTM zone 48N</code></pre>
 </div>
 </div>
 <section id="format-of-spatial-objects-sf" class="level3" data-number="1.3.1">
-<h3 data-number="1.3.1" class="anchored" data-anchor-id="format-of-spatial-objects-sf"><span class="header-section-number">1.3.1</span> Format of spatial objects <code>sf</code></h3>
+<h3 data-number="1.3.1"><span class="header-section-number">1.3.1</span> Format of spatial objects <code>sf</code></h3>
 <div class="quarto-figure quarto-figure-center">
-<figure class="figure">
-<p><img src="img/sf.png" class="img-fluid figure-img" width="600"></p>
+<figure>
+<p><img src="img/sf.png" class="img-fluid" width="600" /></p>
 </figure>
 </div>
 <p>Objects<code>sf</code> are objects in <code>data.frame</code> which one of the columns contains geometries. This column is the class of sfc (<em>simple feature column</em>) and each individual of the column is a sfg <em>(simple feature geometry)</em>. This format is very practical insofa as the data and the geometries are intrinsically linked in the same object.</p>
 <div class="callout-note callout callout-style-simple no-icon">
 <div class="callout-body d-flex">
 <div class="callout-icon-container">
-<i class="callout-icon no-icon"></i>
+<i class='callout-icon no-icon'></i>
 </div>
 <div class="callout-body-container">
 <p>Thumbnail describing the simple feature format: <a href="https://r-spatial.github.io/sf/articles/sf1.html">Simple Features for R</a></p>
@@ -479,7 +489,7 @@ Projected CRS: WGS 84 / UTM zone 48N</code></pre>
 <div class="callout-tip callout callout-style-default callout-captioned">
 <div class="callout-header d-flex align-content-center">
 <div class="callout-icon-container">
-<i class="callout-icon"></i>
+<i class='callout-icon'></i>
 </div>
 <div class="callout-caption-container flex-fill">
 Tip
@@ -492,21 +502,21 @@ Tip
 </section>
 </section>
 <section id="package-mapsf" class="level2" data-number="1.4">
-<h2 data-number="1.4" class="anchored" data-anchor-id="package-mapsf"><span class="header-section-number">1.4</span> Package <code>mapsf</code></h2>
-<p>The free R software spatial ecosystem is rich, dynamic and mature and several packages allow to import, process and represent spatial data. The package <a href="https://CRAN.R-project.org/package=maps"><code>mapsf</code></a> <span class="citation" data-cites="mapsf">(<a href="references.html#ref-mapsf" role="doc-biblioref">Giraud 2022</a>)</span> relies on this ecosystem to integrate the creation of quality thematic maps into processing chains with R.</p>
-<p>Other packages can be used to make thematic maps. The package <code>ggplot2</code> <span class="citation" data-cites="ggplot2">(<a href="references.html#ref-ggplot2" role="doc-biblioref">Wickham 2016</a>)</span>, in association with the package <code>ggspatial</code> <span class="citation" data-cites="ggspatial">(<a href="references.html#ref-ggspatial" role="doc-biblioref">Dunnington 2021</a>)</span>, allows for example to display spatial objects and to make simple thematic maps. The package <code>tmap</code> <span class="citation" data-cites="tmap">(<a href="references.html#ref-tmap" role="doc-biblioref">Tennekes 2018</a>)</span> is dedicated to the creation of thematic maps, it uses a syntax close to that of <code>ggplot2</code> (sequence of instructions combined with the ‘+’ sign). Documentation and tutorials for using these two packages are readily available on the web.</p>
+<h2 data-number="1.4"><span class="header-section-number">1.4</span> Package <code>mapsf</code></h2>
+<p>The free R software spatial ecosystem is rich, dynamic and mature and several packages allow to import, process and represent spatial data. The package <a href="https://CRAN.R-project.org/package=maps"><code>mapsf</code></a> <span class="citation" data-cites="mapsf">(<a href="#ref-mapsf" role="doc-biblioref">Giraud 2022</a>)</span> relies on this ecosystem to integrate the creation of quality thematic maps into processing chains with R.</p>
+<p>Other packages can be used to make thematic maps. The package <code>ggplot2</code> <span class="citation" data-cites="ggplot2">(<a href="#ref-ggplot2" role="doc-biblioref">Wickham 2016</a>)</span>, in association with the package <code>ggspatial</code> <span class="citation" data-cites="ggspatial">(<a href="#ref-ggspatial" role="doc-biblioref">Dunnington 2021</a>)</span>, allows for example to display spatial objects and to make simple thematic maps. The package <code>tmap</code> <span class="citation" data-cites="tmap">(<a href="#ref-tmap" role="doc-biblioref">Tennekes 2018</a>)</span> is dedicated to the creation of thematic maps, it uses a syntax close to that of <code>ggplot2</code> (sequence of instructions combined with the ‘+’ sign). Documentation and tutorials for using these two packages are readily available on the web.</p>
 <p>Here, we will mainly use the package <code>mapsf</code> whose functionalities are quite complete and the handling rather simple. In addition, the package is relatively light.</p>
-<p><img src="img/logo_mapsf.png" align="right" width="120"></p>
-<p><code>mapsf</code> allows you to create most of the types of map usually used in statistical cartography (choropleth maps, typologies, proportional or graduated symbols, etc.). For each type of map, several parameters are used to customize the cartographic representation. These parameters are the same as those found in the usual GIS or cartography software (for example, the choice of discretizations and color palettes, the modification of the size of the symbols or the customization of the legends). Associated with the data representation functions, other functions are dedicated to cartographic dressing (themes or graphic charters, legends, scales, orientation arrows, title, credits, annotations, etc.), the creation of boxes or the exporting maps.<br>
-<code>mapsf</code> is the successor of <a href="http://riatelab.github.io/cartography/docs/"><code>cartography</code></a> <span class="citation" data-cites="cartography">(<a href="references.html#ref-cartography" role="doc-biblioref">Giraud and Lambert 2016</a>)</span>, it offers the same main functionalities while being lighter and more ergonomic.</p>
+<p><img src="img/logo_mapsf.png" align="right" width="120"/></p>
+<p><code>mapsf</code> allows you to create most of the types of map usually used in statistical cartography (choropleth maps, typologies, proportional or graduated symbols, etc.). For each type of map, several parameters are used to customize the cartographic representation. These parameters are the same as those found in the usual GIS or cartography software (for example, the choice of discretizations and color palettes, the modification of the size of the symbols or the customization of the legends). Associated with the data representation functions, other functions are dedicated to cartographic dressing (themes or graphic charters, legends, scales, orientation arrows, title, credits, annotations, etc.), the creation of boxes or the exporting maps.<br />
+<code>mapsf</code> is the successor of <a href="http://riatelab.github.io/cartography/docs/"><code>cartography</code></a> <span class="citation" data-cites="cartography">(<a href="#ref-cartography" role="doc-biblioref">Giraud and Lambert 2016</a>)</span>, it offers the same main functionalities while being lighter and more ergonomic.</p>
 <p>To use this package several sources can be consulted:</p>
 <ul>
 <li><p>The package documentation accessible <a href="http://riatelab.github.io/mapsf/">on the internet</a> or directly in R (<code>?mapsf</code>),</p></li>
 <li><p>A <a href="https://raw.githubusercontent.com/riatelab/mapsf/master/vignettes/web_only/img/mapsf_cheatsheet.pdf"><em>cheat sheet</em></a>,</p></li>
 </ul>
 <div class="quarto-figure quarto-figure-center">
-<figure class="figure">
-<p><img src="img/mapsf_cheatsheet.png" class="img-fluid figure-img" width="600"></p>
+<figure>
+<p><img src="img/mapsf_cheatsheet.png" class="img-fluid" width="600" /></p>
 </figure>
 </div>
 <ul>
@@ -515,12 +525,12 @@ Tip
 </ul>
 </section>
 <section id="the-package-terra" class="level2" data-number="1.5">
-<h2 data-number="1.5" class="anchored" data-anchor-id="the-package-terra"><span class="header-section-number">1.5</span> The package <code>terra</code></h2>
-<p><img src="img/logo_terra.png" align="right" width="150"> The package <code>terra</code> was release in early 2020 by Robert J. Hijmans (also author of <code>raster</code>). Its objective is to propose methods of treatment and analysis of raster data. This package is very similar to the package <code>raster</code>; but it has more features, it’s easier to use, and it’s faster.</p>
+<h2 data-number="1.5"><span class="header-section-number">1.5</span> The package <code>terra</code></h2>
+<p><img src="img/logo_terra.png" align="right" width="150"/> The package <code>terra</code> was release in early 2020 by Robert J. Hijmans (also author of <code>raster</code>). Its objective is to propose methods of treatment and analysis of raster data. This package is very similar to the package <code>raster</code>; but it has more features, it’s easier to use, and it’s faster.</p>
 <div class="callout-note callout callout-style-simple no-icon">
 <div class="callout-body d-flex">
 <div class="callout-icon-container">
-<i class="callout-icon no-icon"></i>
+<i class='callout-icon no-icon'></i>
 </div>
 <div class="callout-body-container">
 <p>Website of package <code>terra</code> : <a href="https://rspatial.org/terra/">Spatial Data Science with R and “terra”</a></p>
@@ -530,7 +540,7 @@ Tip
 <div class="callout-tip callout callout-style-default callout-captioned">
 <div class="callout-header d-flex align-content-center">
 <div class="callout-icon-container">
-<i class="callout-icon"></i>
+<i class='callout-icon'></i>
 </div>
 <div class="callout-caption-container flex-fill">
 Tip
@@ -540,9 +550,13 @@ Tip
 <p>A benchmark of raster processing libraries is available <a href="https://github.com/kadyb/raster-benchmark">here</a>.</p>
 </div>
 </div>
-
-
-<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography" style="display: none">
+<div id="quarto-navigation-envelope" class="hidden">
+<p><span class="hidden" data-render-id="quarto-int-sidebar-title">Mapping and spatial analyses in R for One Health studies</span> <span class="hidden" data-render-id="quarto-int-navbar-title">Mapping and spatial analyses in R for One Health studies</span> <span class="hidden" data-render-id="quarto-int-next"><span class="chapter-number">2</span>  <span class="chapter-title">Data Acquisition</span></span> <span class="hidden" data-render-id="quarto-int-prev">Preface</span> <span class="hidden" data-render-id="quarto-int-sidebar:/index.html">Preface</span> <span class="hidden" data-render-id="quarto-int-sidebar:/01-introduction.html"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/02-data_acquisition.html"><span class="chapter-number">2</span>  <span class="chapter-title">Data Acquisition</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/03-vector_data.html"><span class="chapter-number">3</span>  <span class="chapter-title">Using vector data</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/04-raster_data.html"><span class="chapter-number">4</span>  <span class="chapter-title">Using raster data</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/05-mapping_with_r.html"><span class="chapter-number">5</span>  <span class="chapter-title">Mapping With R</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/07-basic_statistics.html"><span class="chapter-number">6</span>  <span class="chapter-title">Basic statistics for spatial analysis</span></span> <span class="hidden" data-render-id="quarto-int-sidebar:/references.html">References</span> <span class="hidden" data-render-id="footer-left">UMR 228 ESPACE-DEV</span> <span class="hidden" data-render-id="footer-right"><img src="img/ird_footer.png" height="50" /></span></p>
+</div>
+<div id="quarto-meta-markdown" class="hidden">
+<p><span class="hidden" data-render-id="quarto-metatitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-twittercardtitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-ogcardtitle">Mapping and spatial analyses in R for One Health studies - <span id="introductionx" class="quarto-section-identifier"><span class="chapter-number">1</span>  <span class="chapter-title">Introduction</span></span></span> <span class="hidden" data-render-id="quarto-metasitename">Mapping and spatial analyses in R for One Health studies</span></p>
+</div>
+<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">
 <div id="ref-rgdal" class="csl-entry" role="doc-biblioentry">
 Bivand, Roger, Tim Keitt, and Barry Rowlingson. 2022. <span>“Rgdal: Bindings for the ’Geospatial’ Data Abstraction Library.”</span> <a href="https://CRAN.R-project.org/package=rgdal">https://CRAN.R-project.org/package=rgdal</a>.
 </div>
@@ -592,7 +606,7 @@ Wickham, Hadley. 2016. <span>“Ggplot2: Elegant Graphics for Data Analysis.”<
 </section>
 
 </main> <!-- /main -->
-<script id="quarto-html-after-body" type="application/javascript">
+<script id = "quarto-html-after-body" type="application/javascript">
 window.document.addEventListener("DOMContentLoaded", function (event) {
   const toggleBodyColorMode = (bsSheetEl) => {
     const mode = bsSheetEl.getAttribute("data-mode");
@@ -706,25 +720,29 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
 </script>
 <nav class="page-navigation">
   <div class="nav-page nav-page-previous">
-      <a href="./index.html" class="pagination-link">
+      <a  href="/index.html" class="pagination-link">
         <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Preface</span>
       </a>          
   </div>
   <div class="nav-page nav-page-next">
-      <a href="./02-data_acquisition.html" class="pagination-link">
-        <span class="nav-page-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Data Acquisition</span></span> <i class="bi bi-arrow-right-short"></i>
+      <a  href="/02-data_acquisition.html" class="pagination-link">
+        <span class="nav-page-text"><span class='chapter-number'>2</span>  <span class='chapter-title'>Data Acquisition</span></span> <i class="bi bi-arrow-right-short"></i>
       </a>
   </div>
 </nav>
 </div> <!-- /content -->
 <footer class="footer">
   <div class="nav-footer">
-    <div class="nav-footer-left">UMR 228 ESPACE-DEV</div>   
-    <div class="nav-footer-right"><img src="img/ird_footer.png" height="50"></div>
+    <div class="nav-footer-left">
+      <div class='footer-contents'>UMR 228 ESPACE-DEV</div>  
+    </div>   
+    <div class="nav-footer-right">
+      <div class='footer-contents'>![](img/ird_footer.png){height="50"}
+</div>  
+    </div>
   </div>
 </footer>
 
+</body>
 
-
-<script src="site_libs/quarto-html/zenscroll-min.js"></script>
-</body></html>
\ No newline at end of file
+</html>
\ No newline at end of file
diff --git a/public/07-basic_statistics.html b/public/07-basic_statistics.html
index 406cef8bb0f4683646bd0902e3c4fd8e8db01adb..be4b78e87e1eeb8d08ba2a8072828c533a9c13ba 100644
--- a/public/07-basic_statistics.html
+++ b/public/07-basic_statistics.html
@@ -490,18 +490,20 @@ Moran’s I test
 <span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(spdep) <span class="co"># Functions for creating spatial weight, spatial analysis</span></span>
 <span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(DCluster)  <span class="co"># Package with functions for spatial cluster analysis</span></span>
 <span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a></span>
-<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a>queen_nb <span class="ot">&lt;-</span> <span class="fu">poly2nb</span>(district) <span class="co"># Neighbors according to queen case</span></span>
-<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a>q_listw <span class="ot">&lt;-</span> <span class="fu">nb2listw</span>(queen_nb, <span class="at">style =</span> <span class="st">'W'</span>) <span class="co"># row-standardized weights</span></span>
-<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a></span>
-<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Moran's I test</span></span>
-<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a>m_test <span class="ot">&lt;-</span> <span class="fu">moranI.test</span>(cases <span class="sc">~</span> <span class="fu">offset</span>(<span class="fu">log</span>(expected)), </span>
-<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a>                  <span class="at">data =</span> district,</span>
-<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a>                  <span class="at">model =</span> <span class="st">'poisson'</span>,</span>
-<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a>                  <span class="at">R =</span> <span class="dv">499</span>,</span>
-<span id="cb9-14"><a href="#cb9-14" aria-hidden="true" tabindex="-1"></a>                  <span class="at">listw =</span> q_listw,</span>
-<span id="cb9-15"><a href="#cb9-15" aria-hidden="true" tabindex="-1"></a>                  <span class="at">n =</span> <span class="fu">length</span>(district<span class="sc">$</span>cases), <span class="co"># number of regions</span></span>
-<span id="cb9-16"><a href="#cb9-16" aria-hidden="true" tabindex="-1"></a>                  <span class="at">S0 =</span> <span class="fu">Szero</span>(q_listw)) <span class="co"># Global sum of weights</span></span>
-<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(m_test)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
+<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">345</span>) <span class="co"># remove random sampling for reproducibility</span></span>
+<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a>queen_nb <span class="ot">&lt;-</span> <span class="fu">poly2nb</span>(district) <span class="co"># Neighbors according to queen case</span></span>
+<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a>q_listw <span class="ot">&lt;-</span> <span class="fu">nb2listw</span>(queen_nb, <span class="at">style =</span> <span class="st">'W'</span>) <span class="co"># row-standardized weights</span></span>
+<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a></span>
+<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a><span class="co"># Moran's I test</span></span>
+<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a>m_test <span class="ot">&lt;-</span> <span class="fu">moranI.test</span>(cases <span class="sc">~</span> <span class="fu">offset</span>(<span class="fu">log</span>(expected)), </span>
+<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a>                  <span class="at">data =</span> district,</span>
+<span id="cb9-14"><a href="#cb9-14" aria-hidden="true" tabindex="-1"></a>                  <span class="at">model =</span> <span class="st">'poisson'</span>,</span>
+<span id="cb9-15"><a href="#cb9-15" aria-hidden="true" tabindex="-1"></a>                  <span class="at">R =</span> <span class="dv">499</span>,</span>
+<span id="cb9-16"><a href="#cb9-16" aria-hidden="true" tabindex="-1"></a>                  <span class="at">listw =</span> q_listw,</span>
+<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a>                  <span class="at">n =</span> <span class="fu">length</span>(district<span class="sc">$</span>cases), <span class="co"># number of regions</span></span>
+<span id="cb9-18"><a href="#cb9-18" aria-hidden="true" tabindex="-1"></a>                  <span class="at">S0 =</span> <span class="fu">Szero</span>(q_listw)) <span class="co"># Global sum of weights</span></span>
+<span id="cb9-19"><a href="#cb9-19" aria-hidden="true" tabindex="-1"></a><span class="fu">print</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 cell-output-stdout">
 <pre class="code-out"><code>Moran's I test of spatial autocorrelation 
 
@@ -509,14 +511,14 @@ Moran’s I test
     Model used when sampling: Poisson 
     Number of simulations: 499 
     Statistic:  0.1566449 
-    p-value :  0.012 </code></pre>
+    p-value :  0.006 </code></pre>
 </div>
 <div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-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.012. 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.006. 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>
 </section>
 <section id="the-local-morans-i-lisa-test" class="level4" data-number="6.2.2.2">
 <h4 data-number="6.2.2.2" class="anchored" data-anchor-id="the-local-morans-i-lisa-test"><span class="header-section-number">6.2.2.2</span> The Local Moran’s I LISA test</h4>
@@ -731,7 +733,7 @@ Kulldorf test
 <span id="cb30-7"><a href="#cb30-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.016</code></pre>
+1 3.767698              16       4.246625   0.008</code></pre>
 </div>
 </div>
 <p>We only have one secondary cluster composed of one district.</p>
@@ -811,6 +813,19 @@ To go further …
 </div>
 </div>
 <p>Both methods identified significant clusters. The two methods could identify a cluster around Phnom Penh after standardization for population counts. However, the identified clusters does not rely on the same assumption. While the Moran’s test wonder whether their is any autocorrelation between clusters (i.e.&nbsp;second order effects of infection), the Kulldorff scan statistics wonder whether their is any heterogeneity in the case distribution. None of these test can inform on the infection processes (first or second order) for the studied disease and previous knowledge on the disease will help selecting the most accurate test.</p>
+<div class="callout-tip callout callout-style-default callout-captioned">
+<div class="callout-header d-flex align-content-center">
+<div class="callout-icon-container">
+<i class="callout-icon"></i>
+</div>
+<div class="callout-caption-container flex-fill">
+Tip
+</div>
+</div>
+<div class="callout-body-container callout-body">
+<p>In this example, Cambodia is treated as an island, i.e.&nbsp;there is no data outside of its borders. In reality, some clusters can occurs across country’s borders. You should be aware that such district will likely not be detected by these analysis. This border effect is still a hot topic in spatial studies and there is no conventional ways to deal with it. You can find in the literature some suggestion on how to deals with these border effect as assigning weights, or extrapolating data.</p>
+</div>
+</div>
 
 
 <div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography" style="display: none">
diff --git a/public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png b/public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png
index 76ae8864b9449bba6e98e23a670c17810e981a62..50d87dcb927ba7e92be21f09f7d6a15ac65728f9 100644
Binary files a/public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png and b/public/07-basic_statistics_files/figure-html/LocalMoransI_plt-1.png differ
diff --git a/public/07-basic_statistics_files/figure-html/MoransI-1.png b/public/07-basic_statistics_files/figure-html/MoransI-1.png
index 0478ef26de09ec4f3dd1cc5ffd02b139739a77ef..98094aa161f6e397c26a7ec8d8edf1c4d5869519 100644
Binary files a/public/07-basic_statistics_files/figure-html/MoransI-1.png and b/public/07-basic_statistics_files/figure-html/MoransI-1.png differ
diff --git a/public/07-basic_statistics_files/figure-html/conclusion-1.png b/public/07-basic_statistics_files/figure-html/conclusion-1.png
index e2980fa56673b91cf6ad01be83aa50db5bdb8802..82d84837d73e06cb686e796bce170ac50d9b607c 100644
Binary files a/public/07-basic_statistics_files/figure-html/conclusion-1.png and b/public/07-basic_statistics_files/figure-html/conclusion-1.png differ
diff --git a/public/07-basic_statistics_files/figure-html/kd_test-1.png b/public/07-basic_statistics_files/figure-html/kd_test-1.png
index cd2936975ada7ef831ec76b61957bb70cf5d6024..9bde720265ae5777c176d45dd10512ed984b4e38 100644
Binary files a/public/07-basic_statistics_files/figure-html/kd_test-1.png and b/public/07-basic_statistics_files/figure-html/kd_test-1.png differ
diff --git a/public/search.json b/public/search.json
index aa6aea2b94fea4866d70846e82b6867c88577416..9bf7ba5be927f3f76665b23d46b923fa3a445862 100644
--- a/public/search.json
+++ b/public/search.json
@@ -18,7 +18,7 @@
     "href": "07-basic_statistics.html#cluster-analysis",
     "title": "6  Basic statistics for spatial analysis",
     "section": "6.2 Cluster analysis",
-    "text": "6.2 Cluster analysis\n\n6.2.1 General introduction\nWhy studying clusters in epidemiology? Cluster analysis help identifying unusual patterns that occurs during a given period of time. The underlying ultimate goal of such analysis is to explain the observation of such patterns. In epidemiology, we can distinguish two types of process that would explain heterogeneity in case distribution:\n\nThe 1st order effects are the spatial variations of cases distribution caused by underlying properties of environment or the population structure itself. In such process individual get infected independently from the rest of the population. Such process includes the infection through an environment at risk as, for example, air pollution, contaminated waters or soils and UV exposition. This effect assume that the observed pattern is caused by a difference in risk intensity.\nThe 2nd order effects describes process of spread, contagion and diffusion of diseases caused by interactions between individuals. This includes transmission of infectious disease by proximity, but also the transmission of non-infectious disease, for example, with the diffusion of social norms within networks. This effect assume that the observed pattern is caused by correlations or co-variations.\n\n\n\n\n\n\nNo statistical methods could distinguish between these competing processes since their outcome results in similar pattern of points. The cluster analysis help describing the magnitude and the location of pattern but in no way could answer the question of why such patterns occurs. It is therefore a step that help detecting cluster for description and surveillance purpose and rising hypothesis on the underlying process that will lead further investigations.\nKnowledge about the disease and its transmission process could orientate the choice of the methods of study. We presented in this brief tutorial two methods of cluster detection, the Moran’s I test that test for spatial independence (likely related to 2nd order effects) and the scan statistics that test for homogeneous distribution (likely related 1st order effects). It relies on epidemiologist to select the tools that best serve the studied question.\n\n\n\n\n\n\nStatistic tests and distributions\n\n\n\nIn statistics, problems are usually expressed by defining two hypotheses: the null hypothesis (H0), i.e., an a priori hypothesis of the studied phenomenon (e.g., the situation is a random) and the alternative hypothesis (H1), e.g., the situation is not random. The main principle is to measure how likely the observed situation belong to the ensemble of situation that are possible under the H0 hypothesis.\nIn mathematics, a probability distribution is a mathematical expression that represents what we would expect due to random chance. The choice of the probability distribution relies on the type of data you use (continuous, count, binary). In general, three distribution a used while studying disease rates, the Binomial, the Poisson and the Poisson-gamma mixture (also known as negative binomial) distributions.\nMany the statistical tests assume by default that data are normally distributed. It implies that your variable is continuous and that all data could easily be represented by two parameters, the mean and the variance, i.e., each value have the same level of certainty. If many measure can be assessed under the normality assumption, this is usually not the case in epidemiology with strictly positives rates and count values that 1) does not fit the normal distribution and 2) does not provide with the same degree of certainty since variances likely differ between district due to different population size, i.e., some district have very sparse data (with high variance) while other have adequate data (with lower variance).\n\n# dataset statistics\nm_cases <- mean(district$incidence)\nsd_cases <- sd(district$incidence)\n\nhist(district$incidence, probability = TRUE, ylim = c(0, 0.4), xlim = c(-5, 16), xlab = \"Number of cases\", ylab = \"Probability\", main = \"Histogram of observed incidence compared\\nto Normal and Poisson distributions\")\n\ncurve(dnorm(x, m_cases, sd_cases),col = \"blue\",  lwd = 1, add = TRUE)\n\npoints(0:max(district$incidence), dpois(0:max(district$incidence),m_cases),\n       type = 'b', pch = 20, col = \"red\", ylim = c(0, 0.6), lty = 2)\n\nlegend(\"topright\", legend = c(\"Normal distribution\", \"Poisson distribution\", \"Observed distribution\"), col = c(\"blue\", \"red\", \"black\"),pch = c(NA, 20, NA), lty = c(1, 2, 1))\n\n\n\n\nIn this tutorial, we used the Poisson distribution in our statistical tests.\n\n\n\n\n6.2.2 Test for spatial autocorrelation (Moran’s I test)\n\n6.2.2.1 The global Moran’s I test\nA popular test for spatial autocorrelation is the Moran’s test. This test tells us whether nearby units tend to exhibit similar incidences. It ranges from -1 to +1. A value of -1 denote that units with low rates are located near other units with high rates, while a Moran’s I value of +1 indicates a concentration of spatial units exhibiting similar rates.\n\n\n\n\n\n\nMoran’s I test\n\n\n\nThe Moran’s statistics is:\n\\[I = \\frac{N}{\\sum_{i=1}^N\\sum_{j=1}^Nw_{ij}}\\frac{\\sum_{i=1}^N\\sum_{j=1}^Nw_{ij}(Y_i-\\bar{Y})(Y_j - \\bar{Y})}{\\sum_{i=1}^N(Y_i-\\bar{Y})^2}\\] with:\n\n\\(N\\): the number of polygons,\n\\(w_{ij}\\): is a matrix of spatial weight with zeroes on the diagonal (i.e., \\(w_{ii}=0\\)). For example, if polygons are neighbors, the weight takes the value \\(1\\) otherwise it takes the value \\(0\\).\n\\(Y_i\\): the variable of interest,\n\\(\\bar{Y}\\): the mean value of \\(Y\\).\n\nUnder the Moran’s test, the statistics hypotheses are:\n\nH0: the distribution of cases is spatially independent, i.e., \\(I=0\\).\nH1: the distribution of cases is spatially autocorrelated, i.e., \\(I\\ne0\\).\n\n\n\nWe will compute the Moran’s statistics using spdep(R. Bivand et al. 2015) and Dcluster(Gómez-Rubio et al. 2015) packages. spdep package provides a collection of functions to analyze spatial correlations of polygons and works with sp objects. In this example, we use poly2nb() and nb2listw(). These functions respectively detect the neighboring polygons and assign weight corresponding to \\(1/\\#\\ of\\ neighbors\\). Dcluster package provides a set of functions for the detection of spatial clusters of disease using count data.\n\n#install.packages(\"spdep\")\n#install.packages(\"DCluster\")\nlibrary(spdep) # Functions for creating spatial weight, spatial analysis\nlibrary(DCluster)  # Package with functions for spatial cluster analysis\n\nqueen_nb <- poly2nb(district) # Neighbors according to queen case\nq_listw <- nb2listw(queen_nb, style = 'W') # row-standardized weights\n\n# Moran's I test\nm_test <- moranI.test(cases ~ offset(log(expected)), \n                  data = district,\n                  model = 'poisson',\n                  R = 499,\n                  listw = q_listw,\n                  n = length(district$cases), # number of regions\n                  S0 = Szero(q_listw)) # Global sum of weights\nprint(m_test)\n\nMoran's I test of spatial autocorrelation \n\n    Type of boots.: parametric \n    Model used when sampling: Poisson \n    Number of simulations: 499 \n    Statistic:  0.1566449 \n    p-value :  0.012 \n\nplot(m_test)\n\n\n\n\nThe Moran’s statistics is here \\(I =\\) 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. the distribution of cases is spatially independent, is \\(p_{value} =\\) 0.012. We therefore reject H0 with error risk of \\(\\alpha = 5\\%\\). The distribution of cases is therefore autocorrelated across districts in Cambodia.\n\n\n6.2.2.2 The Local Moran’s I LISA test\nThe global Moran’s test provides us a global statistical value informing whether autocorrelation occurs over the territory but does not inform on where does these correlations occurs, i.e., what is the locations of the clusters. To identify such cluster, we can decompose the Moran’s I statistic to extract local information of the level of correlation of each district and its neighbors. This is called the Local Moran’s I LISA statistic. Because the Local Moran’s I LISA statistic test each district for autocorrelation independently, concern is raised about multiple testing limitations that increase the Type I error (\\(\\alpha\\)) of the statistical tests. The use of local test should therefore be study in light of explore and describes clusters once the global test has detected autocorrelation.\n\n\n\n\n\n\nStatistical test\n\n\n\nFor each district \\(i\\), the Local Moran’s I statistics is:\n\\[I_i = \\frac{(Y_i-\\bar{Y})}{\\sum_{i=1}^N(Y_i-\\bar{Y})^2}\\sum_{j=1}^Nw_{ij}(Y_j - \\bar{Y}) \\text{ with }  I = \\sum_{i=1}^NI_i/N\\]\n\n\nThe localmoran()function from the package spdep treats the variable of interest as if it was normally distributed. In some cases, this assumption could be reasonable for incidence rate, especially when the areal units of analysis have sufficiently large population count suggesting that the values have similar level of variances. Unfortunately, the local Moran’s test has not been implemented for Poisson distribution (population not large enough in some districts) in spdep package. However, Bivand et al. (R. S. Bivand et al. 2008) provided some code to manually perform the analysis using Poisson distribution and this code was further implemented in the course “Spatial Epidemiology”.\n\n# Step 1 - Create the standardized deviation of observed from expected\nsd_lm <- (district$cases - district$expected) / sqrt(district$expected)\n\n# Step 2 - Create a spatially lagged version of standardized deviation of neighbors\nwsd_lm <- lag.listw(q_listw, sd_lm)\n\n# Step 3 - the local Moran's I is the product of step 1 and step 2\ndistrict$I_lm <- sd_lm * wsd_lm\n\n# Step 4 - setup parameters for simulation of the null distribution\n\n# Specify number of simulations to run\nnsim <- 499\n\n# Specify dimensions of result based on number of regions\nN <- length(district$expected)\n\n# Create a matrix of zeros to hold results, with a row for each county, and a column for each simulation\nsims <- matrix(0, ncol = nsim, nrow = N)\n\n# Step 5 - Start a for-loop to iterate over simulation columns\nfor(i in 1:nsim){\n  y <- rpois(N, lambda = district$expected) # generate a random event count, given expected\n  sd_lmi <- (y - district$expected) / sqrt(district$expected) # standardized local measure\n  wsd_lmi <- lag.listw(q_listw, sd_lmi) # standardized spatially lagged measure\n  sims[, i] <- sd_lmi * wsd_lmi # this is the I(i) statistic under this iteration of null\n}\n\n# Step 6 - For each county, test where the observed value ranks with respect to the null simulations\nxrank <- apply(cbind(district$I_lm, sims), 1, function(x) rank(x)[1])\n\n# Step 7 - Calculate the difference between observed rank and total possible (nsim)\ndiff <- nsim - xrank\ndiff <- ifelse(diff > 0, diff, 0)\n\n# Step 8 - Assuming a uniform distribution of ranks, calculate p-value for observed\n# given the null distribution generate from simulations\ndistrict$pval_lm <- punif((diff + 1) / (nsim + 1))\n\nBriefly, the process consist on 1) computing the I statistics for the observed data, 2) estimating the null distribution of the I statistics by performing random sampling into a poisson distribution and 3) comparing the observed I statistic with the null distribution to determine the probability to observe such value if the number of cases were spatially independent. For each district, we obtain a p-value based on the comparison of the observed value and the null distribution.\nA conventional way of plotting these results is to classify the districts into 5 classes based on local Moran’s I output. The classification of cluster that are significantly autocorrelated to their neighbors is performed based on a comparison of the scaled incidence in the district compared to the scaled weighted averaged incidence of it neighboring districts (computed with lag.listw()):\n\nDistricts that have higher-than-average rates in both index regions and their neighbors and showing statistically significant positive values for the local \\(I_i\\) statistic are defined as High-High (hotspot of the disease)\nDistricts that have lower-than-average rates in both index regions and their neighbors and showing statistically significant positive values for the local \\(I_i\\) statistic are defined as Low-Low (cold spot of the disease).\nDistricts that have higher-than-average rates in the index regions and lower-than-average rates in their neighbors, and showing statistically significant negative values for the local \\(I_i\\) statistic are defined as High-Low(outlier with high incidence in an area with low incidence).\nDistricts that have lower-than-average rates in the index regions and higher-than-average rates in their neighbors, and showing statistically significant negative values for the local \\(I_i\\) statistic are defined as Low-High (outlier of low incidence in area with high incidence).\nDistricts with non-significant values for the \\(I_i\\) statistic are defined as Non-significant.\n\n\n# create lagged local raw_rate - in other words the average of the queen neighbors value\n# values are scaled (centered and reduced) to be compared to average\ndistrict$lag_std   <- scale(lag.listw(q_listw, var = district$incidence))\ndistrict$incidence_std <- scale(district$incidence)\n\n# extract pvalues\n# district$lm_pv <- lm_test[,5]\n\n# Classify local moran's outputs\ndistrict$lm_class <- NA\ndistrict$lm_class[district$incidence_std >=0 & district$lag_std >=0] <- 'High-High'\ndistrict$lm_class[district$incidence_std <=0 & district$lag_std <=0] <- 'Low-Low'\ndistrict$lm_class[district$incidence_std <=0 & district$lag_std >=0] <- 'Low-High'\ndistrict$lm_class[district$incidence_std >=0 & district$lag_std <=0] <- 'High-Low'\ndistrict$lm_class[district$pval_lm >= 0.05] <- 'Non-significant'\n\ndistrict$lm_class <- factor(district$lm_class, levels=c(\"High-High\", \"Low-Low\", \"High-Low\",  \"Low-High\", \"Non-significant\") )\n\n# create map\nmf_map(x = district,\n       var = \"lm_class\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       #val_order = c(\"High-High\", \"Low-Low\", \"High-Low\",  \"Low-High\", \"Non-significant\") ,\n       pal = c(\"#6D0026\" , \"blue\",  \"white\") , # \"#FF755F\",\"#7FABD3\" ,\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using Local Moran's I statistic\")\n\n\n\n\n\n\n\n6.2.3 Spatial scan statistics\nWhile Moran’s indices focus on testing for autocorrelation between neighboring polygons (under the null assumption of spatial independence), the spatial scan statistic aims at identifying an abnormal higher risk in a given region compared to the risk outside of this region (under the null assumption of homogeneous distribution). The conception of a cluster is therefore different between the two methods.\nThe function kulldorff from the package SpatialEpi (Kim and Wakefield 2010) is a simple tool to implement spatial-only scan statistics.\n\n\n\n\n\n\nKulldorf test\n\n\n\nUnder the kulldorff test, the statistics hypotheses are:\n\nH0: the risk is constant over the area, i.e., there is a spatial homogeneity of the incidence.\nH1: a particular window have higher incidence than the rest of the area , i.e., there is a spatial heterogeneity of incidence.\n\n\n\nBriefly, the kulldorff scan statistics scan the area for clusters using several steps:\n\nIt create a circular window of observation by defining a single location and an associated radius of the windows varying from 0 to a large number that depends on population distribution (largest radius could include 50% of the population).\nIt aggregates the count of events and the population at risk (or an expected count of events) inside and outside the window of observation.\nFinally, it computes the likelihood ratio and test whether the risk is equal inside versus outside the windows (H0) or greater inside the observed window (H1). The H0 distribution is estimated by simulating the distribution of counts under the null hypothesis (homogeneous risk).\nThese 3 steps are repeated for each location and each possible windows-radii.\n\nWhile we test the significance of a large number of observation windows, one can raise concern about multiple testing and Type I error. This approach however suggest that we are not interest in a set of signifiant cluster but only in a most-likely cluster. This a priori restriction eliminate concern for multpile comparison since the test is simplified to a statistically significance of one single most-likely cluster.\nBecause we tested all-possible locations and window-radius, we can also choose to look at secondary clusters. In this case, you should keep in mind that increasing the number of secondary cluster you select, increases the risk for Type I error.\n\n#install.packages(\"SpatialEpi\")\nlibrary(\"SpatialEpi\")\n\nThe use of R spatial object is not implements in kulldorff() function. It uses instead matrix of xy coordinates that represents the centroids of the districts. A given district is included into the observed circular window if its centroids fall into the circle.\n\ndistrict_xy <- st_centroid(district) %>% \n  st_coordinates()\n\nhead(district_xy)\n\n         X       Y\n1 330823.3 1464560\n2 749758.3 1541787\n3 468384.0 1277007\n4 494548.2 1215261\n5 459644.2 1194615\n6 360528.3 1516339\n\n\nWe can then call kulldorff function (you are strongly encouraged to call ?kulldorff to properly call the function). The alpha.level threshold filter for the secondary clusters that will be retained. The most-likely cluster will be saved whatever its significance.\n\nkd_Wfever <- kulldorff(district_xy, \n                cases = district$cases,\n                population = district$T_POP,\n                expected.cases = district$expected,\n                pop.upper.bound = 0.5, # include maximum 50% of the population in a windows\n                n.simulations = 499,\n                alpha.level = 0.2)\n\n\n\n\nThe function plot the histogram of the distribution of log-likelihood ratio simulated under the null hypothesis that is estimated based on Monte Carlo simulations. The observed value of the most significant cluster identified from all possible scans is compared to the distribution to determine significance. All outputs are saved into an R object, here called kd_Wfever. Unfortunately, the package did not develop any summary and visualization of the results but we can explore the output object.\n\nnames(kd_Wfever)\n\n[1] \"most.likely.cluster\" \"secondary.clusters\"  \"type\"               \n[4] \"log.lkhd\"            \"simulated.log.lkhd\" \n\n\nFirst, we can focus on the most likely cluster and explore its characteristics.\n\n# We can see which districts (r number) belong to this cluster\nkd_Wfever$most.likely.cluster$location.IDs.included\n\n [1]  48  93  66 180 133  29 194 118  50 144  31 141   3 117  22  43 142\n\n# standardized incidence ratio\nkd_Wfever$most.likely.cluster$SMR\n\n[1] 2.303106\n\n# number of observed and expected cases in this cluster\nkd_Wfever$most.likely.cluster$number.of.cases\n\n[1] 122\n\nkd_Wfever$most.likely.cluster$expected.cases\n\n[1] 52.97195\n\n\n17 districts belong to the cluster and its number of cases is 2.3 times higher than the expected number of cases.\nSimilarly, we could study the secondary clusters. Results are saved in a list.\n\n# We can see which districts (r number) belong to this cluster\nlength(kd_Wfever$secondary.clusters)\n\n[1] 1\n\n# retrieve data for all secondary clusters into a table\ndf_secondary_clusters <- data.frame(SMR = sapply(kd_Wfever$secondary.clusters, '[[', 5),  \n                          number.of.cases = sapply(kd_Wfever$secondary.clusters, '[[', 3),\n                          expected.cases = sapply(kd_Wfever$secondary.clusters, '[[', 4),\n                          p.value = sapply(kd_Wfever$secondary.clusters, '[[', 8))\n\nprint(df_secondary_clusters)\n\n       SMR number.of.cases expected.cases p.value\n1 3.767698              16       4.246625   0.016\n\n\nWe only have one secondary cluster composed of one district.\n\n# create empty column to store cluster informations\ndistrict$k_cluster <- NA\n\n# save cluster information from kulldorff outputs\ndistrict$k_cluster[kd_Wfever$most.likely.cluster$location.IDs.included] <- 'Most likely cluster'\n\nfor(i in 1:length(kd_Wfever$secondary.clusters)){\ndistrict$k_cluster[kd_Wfever$secondary.clusters[[i]]$location.IDs.included] <- paste(\n  'Secondary cluster', i, sep = '')\n}\n\n#district$k_cluster[is.na(district$k_cluster)] <- \"No cluster\"\n\n\n# create map\nmf_map(x = district,\n       var = \"k_cluster\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = mf_get_pal(palette = \"Reds\", n = 3)[1:2],\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using kulldorf scan statistic\")\n\n\n\n\n\n\n\n\n\n\nTo go further …\n\n\n\nIn this example, the expected number of cases was defined using the population count but note that standardization over other variables as age could also be implemented with the strata parameter in the kulldorff() function.\nIn addition, this cluster analysis was performed solely using the spatial scan but you should keep in mind that this method of cluster detection can be implemented for spatio-temporal data as well where the cluster definition is an abnormal number of cases in a delimited spatial area and during a given period of time. The windows of observation are therefore defined for a different center, radius and time-period. You should take a look at the function scan_ep_poisson() function in the package scanstatistic (Allévius 2018) for this analysis."
+    "text": "6.2 Cluster analysis\n\n6.2.1 General introduction\nWhy studying clusters in epidemiology? Cluster analysis help identifying unusual patterns that occurs during a given period of time. The underlying ultimate goal of such analysis is to explain the observation of such patterns. In epidemiology, we can distinguish two types of process that would explain heterogeneity in case distribution:\n\nThe 1st order effects are the spatial variations of cases distribution caused by underlying properties of environment or the population structure itself. In such process individual get infected independently from the rest of the population. Such process includes the infection through an environment at risk as, for example, air pollution, contaminated waters or soils and UV exposition. This effect assume that the observed pattern is caused by a difference in risk intensity.\nThe 2nd order effects describes process of spread, contagion and diffusion of diseases caused by interactions between individuals. This includes transmission of infectious disease by proximity, but also the transmission of non-infectious disease, for example, with the diffusion of social norms within networks. This effect assume that the observed pattern is caused by correlations or co-variations.\n\n\n\n\n\n\nNo statistical methods could distinguish between these competing processes since their outcome results in similar pattern of points. The cluster analysis help describing the magnitude and the location of pattern but in no way could answer the question of why such patterns occurs. It is therefore a step that help detecting cluster for description and surveillance purpose and rising hypothesis on the underlying process that will lead further investigations.\nKnowledge about the disease and its transmission process could orientate the choice of the methods of study. We presented in this brief tutorial two methods of cluster detection, the Moran’s I test that test for spatial independence (likely related to 2nd order effects) and the scan statistics that test for homogeneous distribution (likely related 1st order effects). It relies on epidemiologist to select the tools that best serve the studied question.\n\n\n\n\n\n\nStatistic tests and distributions\n\n\n\nIn statistics, problems are usually expressed by defining two hypotheses: the null hypothesis (H0), i.e., an a priori hypothesis of the studied phenomenon (e.g., the situation is a random) and the alternative hypothesis (H1), e.g., the situation is not random. The main principle is to measure how likely the observed situation belong to the ensemble of situation that are possible under the H0 hypothesis.\nIn mathematics, a probability distribution is a mathematical expression that represents what we would expect due to random chance. The choice of the probability distribution relies on the type of data you use (continuous, count, binary). In general, three distribution a used while studying disease rates, the Binomial, the Poisson and the Poisson-gamma mixture (also known as negative binomial) distributions.\nMany the statistical tests assume by default that data are normally distributed. It implies that your variable is continuous and that all data could easily be represented by two parameters, the mean and the variance, i.e., each value have the same level of certainty. If many measure can be assessed under the normality assumption, this is usually not the case in epidemiology with strictly positives rates and count values that 1) does not fit the normal distribution and 2) does not provide with the same degree of certainty since variances likely differ between district due to different population size, i.e., some district have very sparse data (with high variance) while other have adequate data (with lower variance).\n\n# dataset statistics\nm_cases <- mean(district$incidence)\nsd_cases <- sd(district$incidence)\n\nhist(district$incidence, probability = TRUE, ylim = c(0, 0.4), xlim = c(-5, 16), xlab = \"Number of cases\", ylab = \"Probability\", main = \"Histogram of observed incidence compared\\nto Normal and Poisson distributions\")\n\ncurve(dnorm(x, m_cases, sd_cases),col = \"blue\",  lwd = 1, add = TRUE)\n\npoints(0:max(district$incidence), dpois(0:max(district$incidence),m_cases),\n       type = 'b', pch = 20, col = \"red\", ylim = c(0, 0.6), lty = 2)\n\nlegend(\"topright\", legend = c(\"Normal distribution\", \"Poisson distribution\", \"Observed distribution\"), col = c(\"blue\", \"red\", \"black\"),pch = c(NA, 20, NA), lty = c(1, 2, 1))\n\n\n\n\nIn this tutorial, we used the Poisson distribution in our statistical tests.\n\n\n\n\n6.2.2 Test for spatial autocorrelation (Moran’s I test)\n\n6.2.2.1 The global Moran’s I test\nA popular test for spatial autocorrelation is the Moran’s test. This test tells us whether nearby units tend to exhibit similar incidences. It ranges from -1 to +1. A value of -1 denote that units with low rates are located near other units with high rates, while a Moran’s I value of +1 indicates a concentration of spatial units exhibiting similar rates.\n\n\n\n\n\n\nMoran’s I test\n\n\n\nThe Moran’s statistics is:\n\\[I = \\frac{N}{\\sum_{i=1}^N\\sum_{j=1}^Nw_{ij}}\\frac{\\sum_{i=1}^N\\sum_{j=1}^Nw_{ij}(Y_i-\\bar{Y})(Y_j - \\bar{Y})}{\\sum_{i=1}^N(Y_i-\\bar{Y})^2}\\] with:\n\n\\(N\\): the number of polygons,\n\\(w_{ij}\\): is a matrix of spatial weight with zeroes on the diagonal (i.e., \\(w_{ii}=0\\)). For example, if polygons are neighbors, the weight takes the value \\(1\\) otherwise it takes the value \\(0\\).\n\\(Y_i\\): the variable of interest,\n\\(\\bar{Y}\\): the mean value of \\(Y\\).\n\nUnder the Moran’s test, the statistics hypotheses are:\n\nH0: the distribution of cases is spatially independent, i.e., \\(I=0\\).\nH1: the distribution of cases is spatially autocorrelated, i.e., \\(I\\ne0\\).\n\n\n\nWe will compute the Moran’s statistics using spdep(R. Bivand et al. 2015) and Dcluster(Gómez-Rubio et al. 2015) packages. spdep package provides a collection of functions to analyze spatial correlations of polygons and works with sp objects. In this example, we use poly2nb() and nb2listw(). These functions respectively detect the neighboring polygons and assign weight corresponding to \\(1/\\#\\ of\\ neighbors\\). Dcluster package provides a set of functions for the detection of spatial clusters of disease using count data.\n\n#install.packages(\"spdep\")\n#install.packages(\"DCluster\")\nlibrary(spdep) # Functions for creating spatial weight, spatial analysis\nlibrary(DCluster)  # Package with functions for spatial cluster analysis\n\nset.seed(345) # remove random sampling for reproducibility\n\nqueen_nb <- poly2nb(district) # Neighbors according to queen case\nq_listw <- nb2listw(queen_nb, style = 'W') # row-standardized weights\n\n# Moran's I test\nm_test <- moranI.test(cases ~ offset(log(expected)), \n                  data = district,\n                  model = 'poisson',\n                  R = 499,\n                  listw = q_listw,\n                  n = length(district$cases), # number of regions\n                  S0 = Szero(q_listw)) # Global sum of weights\nprint(m_test)\n\nMoran's I test of spatial autocorrelation \n\n    Type of boots.: parametric \n    Model used when sampling: Poisson \n    Number of simulations: 499 \n    Statistic:  0.1566449 \n    p-value :  0.006 \n\nplot(m_test)\n\n\n\n\nThe Moran’s statistics is here \\(I =\\) 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. the distribution of cases is spatially independent, is \\(p_{value} =\\) 0.006. We therefore reject H0 with error risk of \\(\\alpha = 5\\%\\). The distribution of cases is therefore autocorrelated across districts in Cambodia.\n\n\n6.2.2.2 The Local Moran’s I LISA test\nThe global Moran’s test provides us a global statistical value informing whether autocorrelation occurs over the territory but does not inform on where does these correlations occurs, i.e., what is the locations of the clusters. To identify such cluster, we can decompose the Moran’s I statistic to extract local information of the level of correlation of each district and its neighbors. This is called the Local Moran’s I LISA statistic. Because the Local Moran’s I LISA statistic test each district for autocorrelation independently, concern is raised about multiple testing limitations that increase the Type I error (\\(\\alpha\\)) of the statistical tests. The use of local test should therefore be study in light of explore and describes clusters once the global test has detected autocorrelation.\n\n\n\n\n\n\nStatistical test\n\n\n\nFor each district \\(i\\), the Local Moran’s I statistics is:\n\\[I_i = \\frac{(Y_i-\\bar{Y})}{\\sum_{i=1}^N(Y_i-\\bar{Y})^2}\\sum_{j=1}^Nw_{ij}(Y_j - \\bar{Y}) \\text{ with }  I = \\sum_{i=1}^NI_i/N\\]\n\n\nThe localmoran()function from the package spdep treats the variable of interest as if it was normally distributed. In some cases, this assumption could be reasonable for incidence rate, especially when the areal units of analysis have sufficiently large population count suggesting that the values have similar level of variances. Unfortunately, the local Moran’s test has not been implemented for Poisson distribution (population not large enough in some districts) in spdep package. However, Bivand et al. (R. S. Bivand et al. 2008) provided some code to manually perform the analysis using Poisson distribution and this code was further implemented in the course “Spatial Epidemiology”.\n\n# Step 1 - Create the standardized deviation of observed from expected\nsd_lm <- (district$cases - district$expected) / sqrt(district$expected)\n\n# Step 2 - Create a spatially lagged version of standardized deviation of neighbors\nwsd_lm <- lag.listw(q_listw, sd_lm)\n\n# Step 3 - the local Moran's I is the product of step 1 and step 2\ndistrict$I_lm <- sd_lm * wsd_lm\n\n# Step 4 - setup parameters for simulation of the null distribution\n\n# Specify number of simulations to run\nnsim <- 499\n\n# Specify dimensions of result based on number of regions\nN <- length(district$expected)\n\n# Create a matrix of zeros to hold results, with a row for each county, and a column for each simulation\nsims <- matrix(0, ncol = nsim, nrow = N)\n\n# Step 5 - Start a for-loop to iterate over simulation columns\nfor(i in 1:nsim){\n  y <- rpois(N, lambda = district$expected) # generate a random event count, given expected\n  sd_lmi <- (y - district$expected) / sqrt(district$expected) # standardized local measure\n  wsd_lmi <- lag.listw(q_listw, sd_lmi) # standardized spatially lagged measure\n  sims[, i] <- sd_lmi * wsd_lmi # this is the I(i) statistic under this iteration of null\n}\n\n# Step 6 - For each county, test where the observed value ranks with respect to the null simulations\nxrank <- apply(cbind(district$I_lm, sims), 1, function(x) rank(x)[1])\n\n# Step 7 - Calculate the difference between observed rank and total possible (nsim)\ndiff <- nsim - xrank\ndiff <- ifelse(diff > 0, diff, 0)\n\n# Step 8 - Assuming a uniform distribution of ranks, calculate p-value for observed\n# given the null distribution generate from simulations\ndistrict$pval_lm <- punif((diff + 1) / (nsim + 1))\n\nBriefly, the process consist on 1) computing the I statistics for the observed data, 2) estimating the null distribution of the I statistics by performing random sampling into a poisson distribution and 3) comparing the observed I statistic with the null distribution to determine the probability to observe such value if the number of cases were spatially independent. For each district, we obtain a p-value based on the comparison of the observed value and the null distribution.\nA conventional way of plotting these results is to classify the districts into 5 classes based on local Moran’s I output. The classification of cluster that are significantly autocorrelated to their neighbors is performed based on a comparison of the scaled incidence in the district compared to the scaled weighted averaged incidence of it neighboring districts (computed with lag.listw()):\n\nDistricts that have higher-than-average rates in both index regions and their neighbors and showing statistically significant positive values for the local \\(I_i\\) statistic are defined as High-High (hotspot of the disease)\nDistricts that have lower-than-average rates in both index regions and their neighbors and showing statistically significant positive values for the local \\(I_i\\) statistic are defined as Low-Low (cold spot of the disease).\nDistricts that have higher-than-average rates in the index regions and lower-than-average rates in their neighbors, and showing statistically significant negative values for the local \\(I_i\\) statistic are defined as High-Low(outlier with high incidence in an area with low incidence).\nDistricts that have lower-than-average rates in the index regions and higher-than-average rates in their neighbors, and showing statistically significant negative values for the local \\(I_i\\) statistic are defined as Low-High (outlier of low incidence in area with high incidence).\nDistricts with non-significant values for the \\(I_i\\) statistic are defined as Non-significant.\n\n\n# create lagged local raw_rate - in other words the average of the queen neighbors value\n# values are scaled (centered and reduced) to be compared to average\ndistrict$lag_std   <- scale(lag.listw(q_listw, var = district$incidence))\ndistrict$incidence_std <- scale(district$incidence)\n\n# extract pvalues\n# district$lm_pv <- lm_test[,5]\n\n# Classify local moran's outputs\ndistrict$lm_class <- NA\ndistrict$lm_class[district$incidence_std >=0 & district$lag_std >=0] <- 'High-High'\ndistrict$lm_class[district$incidence_std <=0 & district$lag_std <=0] <- 'Low-Low'\ndistrict$lm_class[district$incidence_std <=0 & district$lag_std >=0] <- 'Low-High'\ndistrict$lm_class[district$incidence_std >=0 & district$lag_std <=0] <- 'High-Low'\ndistrict$lm_class[district$pval_lm >= 0.05] <- 'Non-significant'\n\ndistrict$lm_class <- factor(district$lm_class, levels=c(\"High-High\", \"Low-Low\", \"High-Low\",  \"Low-High\", \"Non-significant\") )\n\n# create map\nmf_map(x = district,\n       var = \"lm_class\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       #val_order = c(\"High-High\", \"Low-Low\", \"High-Low\",  \"Low-High\", \"Non-significant\") ,\n       pal = c(\"#6D0026\" , \"blue\",  \"white\") , # \"#FF755F\",\"#7FABD3\" ,\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using Local Moran's I statistic\")\n\n\n\n\n\n\n\n6.2.3 Spatial scan statistics\nWhile Moran’s indices focus on testing for autocorrelation between neighboring polygons (under the null assumption of spatial independence), the spatial scan statistic aims at identifying an abnormal higher risk in a given region compared to the risk outside of this region (under the null assumption of homogeneous distribution). The conception of a cluster is therefore different between the two methods.\nThe function kulldorff from the package SpatialEpi (Kim and Wakefield 2010) is a simple tool to implement spatial-only scan statistics.\n\n\n\n\n\n\nKulldorf test\n\n\n\nUnder the kulldorff test, the statistics hypotheses are:\n\nH0: the risk is constant over the area, i.e., there is a spatial homogeneity of the incidence.\nH1: a particular window have higher incidence than the rest of the area , i.e., there is a spatial heterogeneity of incidence.\n\n\n\nBriefly, the kulldorff scan statistics scan the area for clusters using several steps:\n\nIt create a circular window of observation by defining a single location and an associated radius of the windows varying from 0 to a large number that depends on population distribution (largest radius could include 50% of the population).\nIt aggregates the count of events and the population at risk (or an expected count of events) inside and outside the window of observation.\nFinally, it computes the likelihood ratio and test whether the risk is equal inside versus outside the windows (H0) or greater inside the observed window (H1). The H0 distribution is estimated by simulating the distribution of counts under the null hypothesis (homogeneous risk).\nThese 3 steps are repeated for each location and each possible windows-radii.\n\nWhile we test the significance of a large number of observation windows, one can raise concern about multiple testing and Type I error. This approach however suggest that we are not interest in a set of signifiant cluster but only in a most-likely cluster. This a priori restriction eliminate concern for multpile comparison since the test is simplified to a statistically significance of one single most-likely cluster.\nBecause we tested all-possible locations and window-radius, we can also choose to look at secondary clusters. In this case, you should keep in mind that increasing the number of secondary cluster you select, increases the risk for Type I error.\n\n#install.packages(\"SpatialEpi\")\nlibrary(\"SpatialEpi\")\n\nThe use of R spatial object is not implements in kulldorff() function. It uses instead matrix of xy coordinates that represents the centroids of the districts. A given district is included into the observed circular window if its centroids fall into the circle.\n\ndistrict_xy <- st_centroid(district) %>% \n  st_coordinates()\n\nhead(district_xy)\n\n         X       Y\n1 330823.3 1464560\n2 749758.3 1541787\n3 468384.0 1277007\n4 494548.2 1215261\n5 459644.2 1194615\n6 360528.3 1516339\n\n\nWe can then call kulldorff function (you are strongly encouraged to call ?kulldorff to properly call the function). The alpha.level threshold filter for the secondary clusters that will be retained. The most-likely cluster will be saved whatever its significance.\n\nkd_Wfever <- kulldorff(district_xy, \n                cases = district$cases,\n                population = district$T_POP,\n                expected.cases = district$expected,\n                pop.upper.bound = 0.5, # include maximum 50% of the population in a windows\n                n.simulations = 499,\n                alpha.level = 0.2)\n\n\n\n\nThe function plot the histogram of the distribution of log-likelihood ratio simulated under the null hypothesis that is estimated based on Monte Carlo simulations. The observed value of the most significant cluster identified from all possible scans is compared to the distribution to determine significance. All outputs are saved into an R object, here called kd_Wfever. Unfortunately, the package did not develop any summary and visualization of the results but we can explore the output object.\n\nnames(kd_Wfever)\n\n[1] \"most.likely.cluster\" \"secondary.clusters\"  \"type\"               \n[4] \"log.lkhd\"            \"simulated.log.lkhd\" \n\n\nFirst, we can focus on the most likely cluster and explore its characteristics.\n\n# We can see which districts (r number) belong to this cluster\nkd_Wfever$most.likely.cluster$location.IDs.included\n\n [1]  48  93  66 180 133  29 194 118  50 144  31 141   3 117  22  43 142\n\n# standardized incidence ratio\nkd_Wfever$most.likely.cluster$SMR\n\n[1] 2.303106\n\n# number of observed and expected cases in this cluster\nkd_Wfever$most.likely.cluster$number.of.cases\n\n[1] 122\n\nkd_Wfever$most.likely.cluster$expected.cases\n\n[1] 52.97195\n\n\n17 districts belong to the cluster and its number of cases is 2.3 times higher than the expected number of cases.\nSimilarly, we could study the secondary clusters. Results are saved in a list.\n\n# We can see which districts (r number) belong to this cluster\nlength(kd_Wfever$secondary.clusters)\n\n[1] 1\n\n# retrieve data for all secondary clusters into a table\ndf_secondary_clusters <- data.frame(SMR = sapply(kd_Wfever$secondary.clusters, '[[', 5),  \n                          number.of.cases = sapply(kd_Wfever$secondary.clusters, '[[', 3),\n                          expected.cases = sapply(kd_Wfever$secondary.clusters, '[[', 4),\n                          p.value = sapply(kd_Wfever$secondary.clusters, '[[', 8))\n\nprint(df_secondary_clusters)\n\n       SMR number.of.cases expected.cases p.value\n1 3.767698              16       4.246625   0.008\n\n\nWe only have one secondary cluster composed of one district.\n\n# create empty column to store cluster informations\ndistrict$k_cluster <- NA\n\n# save cluster information from kulldorff outputs\ndistrict$k_cluster[kd_Wfever$most.likely.cluster$location.IDs.included] <- 'Most likely cluster'\n\nfor(i in 1:length(kd_Wfever$secondary.clusters)){\ndistrict$k_cluster[kd_Wfever$secondary.clusters[[i]]$location.IDs.included] <- paste(\n  'Secondary cluster', i, sep = '')\n}\n\n#district$k_cluster[is.na(district$k_cluster)] <- \"No cluster\"\n\n\n# create map\nmf_map(x = district,\n       var = \"k_cluster\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = mf_get_pal(palette = \"Reds\", n = 3)[1:2],\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using kulldorf scan statistic\")\n\n\n\n\n\n\n\n\n\n\nTo go further …\n\n\n\nIn this example, the expected number of cases was defined using the population count but note that standardization over other variables as age could also be implemented with the strata parameter in the kulldorff() function.\nIn addition, this cluster analysis was performed solely using the spatial scan but you should keep in mind that this method of cluster detection can be implemented for spatio-temporal data as well where the cluster definition is an abnormal number of cases in a delimited spatial area and during a given period of time. The windows of observation are therefore defined for a different center, radius and time-period. You should take a look at the function scan_ep_poisson() function in the package scanstatistic (Allévius 2018) for this analysis."
   },
   {
     "objectID": "01-introduction.html",
@@ -249,6 +249,6 @@
     "href": "07-basic_statistics.html#conclusion",
     "title": "6  Basic statistics for spatial analysis",
     "section": "6.3 Conclusion",
-    "text": "6.3 Conclusion\n\npar(mfrow = c(1, 2))\n\n# create map\nmf_map(x = district,\n       var = \"lm_class\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = c(\"#6D0026\" , \"blue\",  \"white\") , # \"#FF755F\",\"#7FABD3\" ,\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using Local Moran's I statistic\")\n\n# create map\nmf_map(x = district,\n       var = \"k_cluster\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = mf_get_pal(palette = \"Reds\", n = 3)[1:2],\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using kulldorf scan statistic\")\n\n\n\n\nBoth methods identified significant clusters. The two methods could identify a cluster around Phnom Penh after standardization for population counts. However, the identified clusters does not rely on the same assumption. While the Moran’s test wonder whether their is any autocorrelation between clusters (i.e. second order effects of infection), the Kulldorff scan statistics wonder whether their is any heterogeneity in the case distribution. None of these test can inform on the infection processes (first or second order) for the studied disease and previous knowledge on the disease will help selecting the most accurate test.\n\n\n\n\nAllévius, Benjamin. 2018. “Scanstatistics: Space-Time Anomaly Detection Using Scan Statistics.” Journal of Open Source Software 3 (25): 515.\n\n\nBivand, Roger S, Edzer J Pebesma, Virgilio Gómez-Rubio, and Edzer Jan Pebesma. 2008. Applied Spatial Data Analysis with r. Vol. 747248717. Springer.\n\n\nBivand, Roger, Micah Altman, Luc Anselin, Renato Assunção, Olaf Berke, Andrew Bernat, and Guillaume Blanchet. 2015. “Package ‘Spdep’.” The Comprehensive R Archive Network.\n\n\nGómez-Rubio, Virgilio, Juan Ferrándiz-Ferragud, Antonio López-Quı́lez, et al. 2015. “Package ‘DCluster’.”\n\n\nKim, Albert Y, and Jon Wakefield. 2010. “R Data and Methods for Spatial Epidemiology: The SpatialEpi Package.” Dept of Statistics, University of Washington."
+    "text": "6.3 Conclusion\n\npar(mfrow = c(1, 2))\n\n# create map\nmf_map(x = district,\n       var = \"lm_class\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = c(\"#6D0026\" , \"blue\",  \"white\") , # \"#FF755F\",\"#7FABD3\" ,\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using Local Moran's I statistic\")\n\n# create map\nmf_map(x = district,\n       var = \"k_cluster\",\n       type = \"typo\",\n       cex = 2,\n       col_na = \"white\",\n       pal = mf_get_pal(palette = \"Reds\", n = 3)[1:2],\n       leg_title = \"Clusters\")\n\nmf_layout(title = \"Cluster using kulldorf scan statistic\")\n\n\n\n\nBoth methods identified significant clusters. The two methods could identify a cluster around Phnom Penh after standardization for population counts. However, the identified clusters does not rely on the same assumption. While the Moran’s test wonder whether their is any autocorrelation between clusters (i.e. second order effects of infection), the Kulldorff scan statistics wonder whether their is any heterogeneity in the case distribution. None of these test can inform on the infection processes (first or second order) for the studied disease and previous knowledge on the disease will help selecting the most accurate test.\n\n\n\n\n\n\nTip\n\n\n\nIn this example, Cambodia is treated as an island, i.e. there is no data outside of its borders. In reality, some clusters can occurs across country’s borders. You should be aware that such district will likely not be detected by these analysis. This border effect is still a hot topic in spatial studies and there is no conventional ways to deal with it. You can find in the literature some suggestion on how to deals with these border effect as assigning weights, or extrapolating data.\n\n\n\n\n\n\nAllévius, Benjamin. 2018. “Scanstatistics: Space-Time Anomaly Detection Using Scan Statistics.” Journal of Open Source Software 3 (25): 515.\n\n\nBivand, Roger S, Edzer J Pebesma, Virgilio Gómez-Rubio, and Edzer Jan Pebesma. 2008. Applied Spatial Data Analysis with r. Vol. 747248717. Springer.\n\n\nBivand, Roger, Micah Altman, Luc Anselin, Renato Assunção, Olaf Berke, Andrew Bernat, and Guillaume Blanchet. 2015. “Package ‘Spdep’.” The Comprehensive R Archive Network.\n\n\nGómez-Rubio, Virgilio, Juan Ferrándiz-Ferragud, Antonio López-Quı́lez, et al. 2015. “Package ‘DCluster’.”\n\n\nKim, Albert Y, and Jon Wakefield. 2010. “R Data and Methods for Spatial Epidemiology: The SpatialEpi Package.” Dept of Statistics, University of Washington."
   }
 ]
\ No newline at end of file