Skip to content

Commit

Permalink
add section for England (:
Browse files Browse the repository at this point in the history
  • Loading branch information
eirini-zormpa committed Apr 30, 2024
1 parent a5b16b1 commit c869694
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
28 changes: 25 additions & 3 deletions scripts/location-selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,29 @@ <h3 class="anchored" data-anchor-id="index-of-multiple-deprivation-access-to-nat
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>pua_imd <span class="sc">%&gt;%</span> </span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(country_name <span class="sc">==</span> <span class="st">"Scotland"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(country_name <span class="sc">==</span> <span class="st">"England"</span>) <span class="sc">%&gt;%</span> </span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(index_of_multiple_deprivation_decile_country_specific, <span class="fu">desc</span>(percentage))</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><code># A tibble: 151 × 5
country_name PUA index_of_multiple_deprivation_d…¹ n percentage
&lt;chr&gt; &lt;chr&gt; &lt;dbl&gt; &lt;int&gt; &lt;dbl&gt;
1 England Liverpool 1 46 46.9
2 England Blackburn 1 33 36.7
3 England Burnley 1 41 35.0
4 England Bradford 1 104 33.5
5 England Middlesbrough 1 89 30.3
6 England Blackpool 1 41 28.3
7 England Birmingham 1 416 28.0
8 England Birkenhead 1 52 25.2
9 England Manchester 1 357 24.2
10 England Doncaster 1 46 23.7
# ℹ 141 more rows
# ℹ abbreviated name: ¹​index_of_multiple_deprivation_decile_country_specific</code></pre>
</div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>pua_imd <span class="sc">%&gt;%</span> </span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(country_name <span class="sc">==</span> <span class="st">"Scotland"</span>)</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><code># A tibble: 3 × 5
country_name PUA index_of_multiple_deprivation_decile_c…¹ n percentage
Expand All @@ -226,8 +248,8 @@ <h3 class="anchored" data-anchor-id="index-of-multiple-deprivation-access-to-nat
</div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>pua_imd <span class="sc">%&gt;%</span> </span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(country_name <span class="sc">==</span> <span class="st">"Wales"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>pua_imd <span class="sc">%&gt;%</span> </span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(country_name <span class="sc">==</span> <span class="st">"Wales"</span>)</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><code># A tibble: 9 × 5
country_name PUA index_of_multiple_deprivation_decile_c…¹ n percentage
Expand Down
10 changes: 8 additions & 2 deletions scripts/location-selection.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,21 @@ puas <- lsoa_parks_play %>%

```{r}
#| echo: false
pua_imd <- puas %>%
pua_imd <- puas %>%
count(country_name, PUA, index_of_multiple_deprivation_decile_country_specific) %>%
group_by(PUA) %>%
group_by(country_name, PUA) %>%
mutate(percentage = (n/sum(n)) * 100) %>%
ungroup() %>%
filter(index_of_multiple_deprivation_decile_country_specific %in% 1:3) %>%
drop_na(PUA)
```

```{r}
pua_imd %>%
filter(country_name == "England") %>%
arrange(index_of_multiple_deprivation_decile_country_specific, desc(percentage))
```

```{r}
pua_imd %>%
filter(country_name == "Scotland")
Expand Down

0 comments on commit c869694

Please sign in to comment.