Commit a9ca0105 authored by Bakaniko's avatar Bakaniko
Browse files

Cours PDM - ajout de précisions, corrections

parent e85c44e4
Pipeline #208317 passed with stages
in 1 minute and 9 seconds
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......@@ -243,18 +242,22 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<h2><span class="header-section-number">2.2</span> Data wrangling with R base</h2>
<div id="load-data" class="section level3">
<h3><span class="header-section-number">2.2.1</span> Load data</h3>
<div id="load-data-from-a-data-set" class="section level4">
<h4><span class="header-section-number">2.2.1.1</span> Load data from a data set:</h4>
<div id="load-data-from-an-embedded-data-set" class="section level4">
<h4><span class="header-section-number">2.2.1.1</span> Load data from an embedded data set:</h4>
<ul>
<li><code>data &lt;- LakeHuron</code></li>
<li>Look at the Environnement panel</li>
<li>type <code>data</code></li>
</ul>
<p>This can be useful to reproduce documentation examples but it is not
your data. You need to load data from the outside.</p>
</div>
<div id="load-data-from-a-csv-file" class="section level4">
<h4><span class="header-section-number">2.2.1.2</span> Load data from a csv file</h4>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb28-1"><a href="data-manipulation-with-r.html#cb28-1"></a>worldbank &lt;-<span class="st"> </span><span class="kw">read.csv</span>(<span class="st">&quot;data/worldbank_df.csv&quot;</span>, <span class="dt">sep =</span> <span class="st">&#39;,&#39;</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>)</span></code></pre></div>
<p><em>sep</em> and <em>header</em> are options to set accordingly</p>
<p><code>"data/worldbank_df.csv"</code> is the path to the file, from the working directory.
Note that, even on Microsoft Windows, path notation use <em>slashes</em> <code>/</code> to separate directories.</p>
<p>sep* and <em>header</em> are options to set accordingly to your file.</p>
<p>This would have work too:</p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="data-manipulation-with-r.html#cb29-1"></a>worldbank &lt;-<span class="st"> </span><span class="kw">read.csv</span>(<span class="st">&quot;data/worldbank_df.csv&quot;</span>)</span></code></pre></div>
</div>
......@@ -263,8 +266,8 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<p>Tips :
- Look into the <strong>Environnement panel</strong>
- use the <code>class</code> function</p>
<p>LakeHuron is a time series, there is just one column with the water height. But the start and ending years are indicated</p>
<p>Worldbank_df is a dataframe with several columns (name, urban pop)</p>
<p>`LakeHuron ̀is a time series, there is just one column with the water height. But the start and ending years are indicated</p>
<p>̀Worldbank_df ̀ is a dataframe with several columns (name, urban pop)</p>
</div>
</div>
<div id="get-some-insight-about-the-data" class="section level3">
......@@ -421,7 +424,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</div>
<div id="boxplot" class="section level4">
<h4><span class="header-section-number">2.2.3.2</span> Boxplot</h4>
<div class="sourceCode" id="cb70"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb70-1"><a href="data-manipulation-with-r.html#cb70-1"></a><span class="co">#New data set </span></span>
<div class="sourceCode" id="cb70"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb70-1"><a href="data-manipulation-with-r.html#cb70-1"></a><span class="co"># New data set provided by the gapminder package </span></span>
<span id="cb70-2"><a href="data-manipulation-with-r.html#cb70-2"></a><span class="kw">library</span>(gapminder) </span>
<span id="cb70-3"><a href="data-manipulation-with-r.html#cb70-3"></a><span class="kw">head</span>(gapminder)</span></code></pre></div>
<pre><code>## # A tibble: 6 x 6
......@@ -531,9 +534,8 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
## 10 1997 Albania 3193.
## # … with 350 more rows</code></pre>
</div>
</div>
<div id="exercice-2" class="section level2">
<h2><span class="header-section-number">2.4</span> Exercice</h2>
<div id="exercice-1-1" class="section level3 unnumbered">
<h3>Exercice 1</h3>
<p>Produce a dataframe that has the African values for lifeExp, country and year, but not for other Continents</p>
<div class="sourceCode" id="cb84"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb84-1"><a href="data-manipulation-with-r.html#cb84-1"></a>year_country_lifeExp_Africa &lt;-<span class="st"> </span>gapminder <span class="op">%&gt;%</span></span>
<span id="cb84-2"><a href="data-manipulation-with-r.html#cb84-2"></a><span class="st"> </span><span class="kw">filter</span>(continent<span class="op">==</span><span class="st">&quot;Africa&quot;</span>) <span class="op">%&gt;%</span><span class="st"> </span></span>
......@@ -553,8 +555,9 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
## 9 1992 Algeria 67.7
## 10 1997 Algeria 69.2
## # … with 614 more rows</code></pre>
</div>
<div id="group_by" class="section level3">
<h3><span class="header-section-number">2.4.1</span> <em>group_by()</em></h3>
<h3><span class="header-section-number">2.3.5</span> <em>group_by()</em></h3>
<p>Group data by a variable.</p>
<div class="sourceCode" id="cb86"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb86-1"><a href="data-manipulation-with-r.html#cb86-1"></a><span class="kw">str</span>(gapminder) </span></code></pre></div>
<pre><code>## Classes &#39;tbl_df&#39;, &#39;tbl&#39; and &#39;data.frame&#39;: 1704 obs. of 6 variables:
......@@ -591,7 +594,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
## ..- attr(*, &quot;.drop&quot;)= logi TRUE</code></pre>
</div>
<div id="summarize" class="section level3">
<h3><span class="header-section-number">2.4.2</span> <em>summarize()</em></h3>
<h3><span class="header-section-number">2.3.6</span> <em>summarize()</em></h3>
<p><code>summarize()</code> aggregates the grouped data with a function (sum, mean, custom, etc.).</p>
<div class="sourceCode" id="cb92"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb92-1"><a href="data-manipulation-with-r.html#cb92-1"></a>gdp_bycontinents &lt;-<span class="st"> </span>gapminder <span class="op">%&gt;%</span></span>
<span id="cb92-2"><a href="data-manipulation-with-r.html#cb92-2"></a><span class="st"> </span><span class="kw">group_by</span>(continent) <span class="op">%&gt;%</span></span>
......@@ -609,8 +612,8 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
## 5 Oceania 18622.</code></pre>
<p>]</p>
</div>
<div id="exercice-1-1" class="section level3 unnumbered">
<h3>Exercice 1</h3>
<div id="exercice-2" class="section level3 unnumbered">
<h3>Exercice 2</h3>
<p>Calculate mean and median life expectancy in South Africa and Ireland</p>
<div id="steps" class="section level4 unnumbered">
<h4>Steps</h4>
......@@ -649,8 +652,8 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<span id="cb96-9"><a href="data-manipulation-with-r.html#cb96-9"></a>AverageLife</span></code></pre></div>
</div>
</div>
<div id="example-2" class="section level3 unnumbered">
<h3>Example 2</h3>
<div id="exercice-3" class="section level3 unnumbered">
<h3>Exercice 3</h3>
<p>Calculate the gap between a mean life expectancy in a country and the world mean life expectancy.</p>
<div id="steps-1" class="section level4 unnumbered">
<h4>Steps</h4>
......@@ -695,7 +698,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<span id="cb98-13"><a href="data-manipulation-with-r.html#cb98-13"></a>mean_lifeExp_gap</span></code></pre></div>
</div>
<div id="sort-data" class="section level4">
<h4><span class="header-section-number">2.4.2.1</span> Sort data</h4>
<h4><span class="header-section-number">2.3.6.1</span> Sort data</h4>
<p>If needed you can <code>arrange</code> <strong>rows</strong> by life expectancy gaps.</p>
<ul>
<li>Ascending order</li>
......@@ -730,7 +733,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</div>
</div>
<div id="commands-order" class="section level3">
<h3><span class="header-section-number">2.4.3</span> Commands order</h3>
<h3><span class="header-section-number">2.3.7</span> Commands order</h3>
<p>Even not mandatory, it is recommended to use that order:</p>
<ol style="list-style-type: decimal">
<li><code>filter</code> the rows</li>
......@@ -739,8 +742,10 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li><code>group by</code> if needed</li>
<li><code>summarize</code> if needed</li>
</ol>
<p><code>filter</code> and <code>select</code> first to reduce the size of the dataset to handle.</p>
<p><code>filter</code> first to avoid issues by not selecting columns that are used to filter.</p>
<ul>
<li><p><code>filter</code> and <code>select</code> first to reduce the size of the dataset to handle.</p></li>
<li><p><code>filter</code> first to avoid issues by not selecting columns that are used to filter.</p></li>
</ul>
<p>Now let’s see how to plot with ggplot2</p>
</div>
......
......@@ -124,7 +124,7 @@
\postauthor{\par}
\predate{\centering\large\emph}
\postdate{\par}
\date{2020-01-28}
\date{2020-01-31}
\usepackage{booktabs}
......@@ -828,8 +828,8 @@ Multiple choices cases
\hypertarget{load-data}{%
\subsection{Load data}\label{load-data}}
\hypertarget{load-data-from-a-data-set}{%
\subsubsection{Load data from a data set:}\label{load-data-from-a-data-set}}
\hypertarget{load-data-from-an-embedded-data-set}{%
\subsubsection{Load data from an embedded data set:}\label{load-data-from-an-embedded-data-set}}
\begin{itemize}
\tightlist
......@@ -841,6 +841,9 @@ Multiple choices cases
type \texttt{data}
\end{itemize}
This can be useful to reproduce documentation examples but it is not
your data. You need to load data from the outside.
\hypertarget{load-data-from-a-csv-file}{%
\subsubsection{Load data from a csv file}\label{load-data-from-a-csv-file}}
......@@ -850,7 +853,10 @@ Multiple choices cases
\end{Highlighting}
\end{Shaded}
\emph{sep} and \emph{header} are options to set accordingly
\texttt{"data/worldbank\_df.csv"} is the path to the file, from the working directory.
Note that, even on Microsoft Windows, path notation use \emph{slashes} \texttt{/} to separate directories.
sep* and \emph{header} are options to set accordingly to your file.
This would have work too:
......@@ -867,9 +873,9 @@ Tips :
- Look into the \textbf{Environnement panel}
- use the \texttt{class} function
LakeHuron is a time series, there is just one column with the water height. But the start and ending years are indicated
`LakeHuron ̀is a time series, there is just one column with the water height. But the start and ending years are indicated
Worldbank\_df is a dataframe with several columns (name, urban pop)
̀Worldbank\_df ̀ is a dataframe with several columns (name, urban pop)
\hypertarget{get-some-insight-about-the-data}{%
\subsection{Get some insight about the data}\label{get-some-insight-about-the-data}}
......@@ -1236,7 +1242,7 @@ For more precision, use vectors
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{#New data set }
\CommentTok{# New data set provided by the gapminder package }
\KeywordTok{library}\NormalTok{(gapminder) }
\KeywordTok{head}\NormalTok{(gapminder)}
\end{Highlighting}
......@@ -1417,8 +1423,9 @@ We will use the \emph{gapminder} dataset:
## # ... with 350 more rows
\end{verbatim}
\hypertarget{exercice-2}{%
\section{Exercice}\label{exercice-2}}
\hypertarget{exercice-1-1}{%
\subsection*{Exercice 1}\label{exercice-1-1}}
\addcontentsline{toc}{subsection}{Exercice 1}
Produce a dataframe that has the African values for lifeExp, country and year, but not for other Continents
......@@ -1539,9 +1546,9 @@ Group data by a variable.
{]}
\hypertarget{exercice-1-1}{%
\subsection*{Exercice 1}\label{exercice-1-1}}
\addcontentsline{toc}{subsection}{Exercice 1}
\hypertarget{exercice-2}{%
\subsection*{Exercice 2}\label{exercice-2}}
\addcontentsline{toc}{subsection}{Exercice 2}
Calculate mean and median life expectancy in South Africa and Ireland
......@@ -1602,9 +1609,9 @@ Calculate mean and median life expectancy in South Africa and Ireland
\end{Highlighting}
\end{Shaded}
\hypertarget{example-2}{%
\subsection*{Example 2}\label{example-2}}
\addcontentsline{toc}{subsection}{Example 2}
\hypertarget{exercice-3}{%
\subsection*{Exercice 3}\label{exercice-3}}
\addcontentsline{toc}{subsection}{Exercice 3}
Calculate the gap between a mean life expectancy in a country and the world mean life expectancy.
......@@ -1744,9 +1751,12 @@ Even not mandatory, it is recommended to use that order:
\texttt{summarize} if needed
\end{enumerate}
\texttt{filter} and \texttt{select} first to reduce the size of the dataset to handle.
\texttt{filter} first to avoid issues by not selecting columns that are used to filter.
\begin{itemize}
\item
\texttt{filter} and \texttt{select} first to reduce the size of the dataset to handle.
\item
\texttt{filter} first to avoid issues by not selecting columns that are used to filter.
\end{itemize}
Now let's see how to plot with ggplot2
......@@ -2478,8 +2488,8 @@ First we should store the map in an object so we won't have to write all the cod
\includegraphics{geospatial_data_in_R_files/figure-latex/unnamed-chunk-27-1.pdf}
\hypertarget{exercice-3}{%
\section{Exercice}\label{exercice-3}}
\hypertarget{exercice-4}{%
\section{Exercice}\label{exercice-4}}
Try to reproduce with the data from 1979 to 1984 (\emph{hint}: use SID79 and BIR79).
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......@@ -231,7 +230,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<div id="header">
<h1 class="title">Introduction to geospatial data with R</h1>
<p class="author"><em>Nicolas Roelandt</em></p>
<p class="date"><em>2020-01-28</em></p>
<p class="date"><em>2020-01-31</em></p>
</div>
<div id="prerequisites" class="section level1 unnumbered">
<h1>Prerequisites</h1>
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......@@ -412,7 +411,7 @@ Those functions are provided by ggplot2.</p>
</div>
</div>
</div>
<div id="exercice-3" class="section level2">
<div id="exercice-4" class="section level2">
<h2><span class="header-section-number">4.2</span> Exercice</h2>
<p>Try to reproduce with the data from 1979 to 1984 (<em>hint</em>: use SID79 and BIR79).</p>
</div>
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2020-01-28" />
<meta name="date" content="2020-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -173,13 +173,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="2.3.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#dataset"><i class="fa fa-check"></i><b>2.3.2</b> Dataset</a></li>
<li class="chapter" data-level="2.3.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#select"><i class="fa fa-check"></i><b>2.3.3</b> <em>select()</em></a></li>
<li class="chapter" data-level="2.3.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#filter"><i class="fa fa-check"></i><b>2.3.4</b> <em>filter()</em></a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i><b>2.4</b> Exercice</a><ul>
<li class="chapter" data-level="2.4.1" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.4.1</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.4.2" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.4.2</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-1-1"><i class="fa fa-check"></i>Exercice 1</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#example-2"><i class="fa fa-check"></i>Example 2</a></li>
<li class="chapter" data-level="2.4.3" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.4.3</b> Commands order</a></li>
<li class="chapter" data-level="2.3.5" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#group_by"><i class="fa fa-check"></i><b>2.3.5</b> <em>group_by()</em></a></li>
<li class="chapter" data-level="2.3.6" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#summarize"><i class="fa fa-check"></i><b>2.3.6</b> <em>summarize()</em></a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-2"><i class="fa fa-check"></i>Exercice 2</a></li>
<li class="chapter" data-level="" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#exercice-3"><i class="fa fa-check"></i>Exercice 3</a></li>
<li class="chapter" data-level="2.3.7" data-path="data-manipulation-with-r.html"><a href="data-manipulation-with-r.html#commands-order"><i class="fa fa-check"></i><b>2.3.7</b> Commands order</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="plotting-with-ggplot2.html"><a href="plotting-with-ggplot2.html"><i class="fa fa-check"></i><b>3</b> Plotting with ggplot2</a><ul>
......@@ -203,7 +202,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="chapter" data-level="4.1.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#making-a-better-map"><i class="fa fa-check"></i><b>4.1.4</b> Making a better map</a></li>
<li class="chapter" data-level="4.1.5" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#adding-a-title-and-a-subtitle"><i class="fa fa-check"></i><b>4.1.5</b> Adding a title and a subtitle</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-3"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.2" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#exercice-4"><i class="fa fa-check"></i><b>4.2</b> Exercice</a></li>
<li class="chapter" data-level="4.3" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#cartography-package"><i class="fa fa-check"></i><b>4.3</b> <code>cartography</code> package</a></li>
<li class="chapter" data-level="4.4" data-path="mapping-with-r-and-sf.html"><a href="mapping-with-r-and-sf.html#whats-next"><i class="fa fa-check"></i><b>4.4</b> What’s next ?</a></li>
</ul></li>
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment