Newer
Older
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<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;
}
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>
<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="./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">
<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>
<link rel="stylesheet" href="styles.css">
</head>
<body class="nav-sidebar floating">
<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"><span class="chapter-number">1</span> <span class="chapter-title">Introduction</span></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>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./06-advanced_spatial_analysis.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span> <span class="chapter-title">Advanced Spatial Analysis</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">7</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">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#spatial-in-r-history-and-evolutions" id="toc-spatial-in-r-history-and-evolutions" class="nav-link active" data-scroll-target="#spatial-in-r-history-and-evolutions"><span class="toc-section-number">1.1</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.2</span> The package <code>sf</code></a>
<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.2.1</span> Format of spatial objects <code>sf</code></a></li>
<li><a href="#package-mapsf" id="toc-package-mapsf" class="nav-link" data-scroll-target="#package-mapsf"><span class="toc-section-number">1.3</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.4</span> The package <code>terra</code></a></li>
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
</ul>
</nav>
</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> <span class="chapter-title">Introduction</span></span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<section id="spatial-in-r-history-and-evolutions" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="spatial-in-r-history-and-evolutions"><span class="header-section-number">1.1</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>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>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>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>
<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.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="the-package-sf"><span class="header-section-number">1.2</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>
</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>
<section id="format-of-spatial-objects-sf" class="level3" data-number="1.2.1">
<h3 data-number="1.2.1" class="anchored" data-anchor-id="format-of-spatial-objects-sf"><span class="header-section-number">1.2.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>
</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.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="package-mapsf"><span class="header-section-number">1.3</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 class="figure">
<p><img src="img/mapsf_cheatsheet.png" class="img-fluid figure-img" 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.4">
<h2 data-number="1.4" class="anchored" data-anchor-id="the-package-terra"><span class="header-section-number">1.4</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="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<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();
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
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');
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
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">UMR 228 ESPACE-DEV</div>
<div class="nav-footer-right"><img src="img/ird_footer.png" height="50"></div>
</div>
</footer>
<script src="site_libs/quarto-html/zenscroll-min.js"></script>