Skip to content

Commit

Permalink
re run OneNum Story after merging pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
holtzy committed Nov 12, 2018
1 parent 35c22dc commit d6a9276
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions story/OneNum.html
Expand Up @@ -238,7 +238,7 @@

<div class="row">
<div class="col-md-8">
<p><br><br><br>This document gives a few suggestions to analyse a dataset composed by a unique numeric variable.<br> It considers the night price of about 10,000 <a href="https://www.airbnb.fr">Airbnb</a> appartements on the French Riviera in France.<br>This example dataset has been downloaded from the <a href="http://insideairbnb.com/get-the-data.html">Airbnb website</a> and is available on this <a href="https://github.com/holtzy/data_to_viz/tree/master/Example_dataset">Github repository</a>. Basically it looks like the table beside.</p>
<p><br><br><br>This document porvides a few suggestions for analying a dataset composed of a unique numeric variable.<br> It considers the nightly price of about 10,000 <a href="https://www.airbnb.fr">Airbnb</a> apartements on the French Riviera in France.<br>This example dataset has been downloaded from the <a href="http://insideairbnb.com/get-the-data.html">Airbnb website</a> and is available on this <a href="https://github.com/holtzy/data_to_viz/tree/master/Example_dataset">Github repository</a>. Basically it looks like the table to the right.</p>
</div>
<div class="col-md-4">
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Libraries</span>
Expand Down Expand Up @@ -299,8 +299,8 @@
<div id="histogram" class="section level1">
<h1>Histogram</h1>
<hr />
<p>The most common way to represent a unique numeric variable is probably to produce a histogram. Basically, the numeric variable is cut in several <code>bins</code>: between 0 and 10 euros a night, between 10 and 20 and so on. This is represented on the X axis. Then, the number of appartment per bin is counted and represented by the Y axis.</p>
<p>Here, it appears that about 500 appartments have a price between 80 and 90 euros. A histogram is a convenient way to visualize the data: it allows to understand its <code>distribution</code>.</p>
<p>The most common way to represent a unique numeric variable is with a histogram. Basically, the numeric variable is cut in several <code>bins</code>: between 0 and 10 euros a night, between 10 and 20 and so on. This is represented on the X axis. Then, the number of apartments per bin is counted and represented on the Y axis.</p>
<p>Here, it appears that about 500 appartments have a price between 80 and 90 euros. A histogram is a convenient way to visualize the data: it allows us to understand its <code>distribution</code>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">data <span class="op">%&gt;%</span>
<span class="st"> </span><span class="kw">filter</span>( price<span class="op">&lt;</span><span class="dv">300</span> ) <span class="op">%&gt;%</span>
<span class="st"> </span><span class="kw">ggplot</span>( <span class="kw">aes</span>(<span class="dt">x=</span>price)) <span class="op">+</span>
Expand All @@ -311,7 +311,7 @@ <h1>Histogram</h1>
<span class="dt">plot.title =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">12</span>)
)</code></pre></div>
<p><img src="OneNum_files/figure-html/unnamed-chunk-2-1.png" width="672" style="display: block; margin: auto;" /></p>
<p>Note that it is really important to play with the <code>bin size</code> during your exploratory analysis. Let’s check what happens when spliting prices by bins of 2 euros instead of 10:</p>
<p>Note that it is important to play with the <code>bin size</code> during your exploratory analysis. Let’s check what happens when spliting prices by bins of 2 euros instead of 10:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">data <span class="op">%&gt;%</span>
<span class="st"> </span><span class="kw">filter</span>( price<span class="op">&lt;</span><span class="dv">300</span> ) <span class="op">%&gt;%</span>
<span class="st"> </span><span class="kw">ggplot</span>( <span class="kw">aes</span>(<span class="dt">x=</span>price)) <span class="op">+</span>
Expand Down

0 comments on commit d6a9276

Please sign in to comment.