Skip to content

Commit 890f3e1

Browse files
committed
Added alt text, small edits and removed whitespace in image files
1 parent 70d6b85 commit 890f3e1

9 files changed

Lines changed: 16 additions & 16 deletions

File tree

blogs/posts/2024-08-08_map-and-nest/index.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library(snakecase)
2222

2323
I want to share a framework that I like using occasionally for data analysis. It's the nest-and-map and it's helped me countless times when I'm working with related datasets. By combining [{purrr}](https://purrr.tidyverse.org/) mapping with [{tidyr}](https://tidyr.tidyverse.org/) nesting, I can keep my analysis steps linked, allowing me to easily track from a summary or plot, back to the original data.
2424

25-
The main funtions we'll need are
25+
The main functions we'll need are
2626

2727
- `tidyr::nest()`
2828
- `dplyr::mutate()`
@@ -99,7 +99,7 @@ I've created two functions, `plot_barchart()` and `plot_waffle()` which take the
9999
<summary>See definition for `plot_barchart()` & `plot_waffle()`</summary>
100100
```{r}
101101
#' Plot barchart
102-
#' Makes a bar chart of staff perentages by organisation
102+
#' Makes a bar chart of staff percentages by organisation
103103
#' @param df tibble of staff data in percent format
104104
plot_barchart <- function(df) {
105105
df |>
@@ -139,7 +139,7 @@ ggplot2::ggplot(waffle_data, ggplot2::aes(fill = names, values = vals)) +
139139

140140
</details>
141141

142-
Again, using `mutate()` I can create a new column called `barchart` and I can `map()` the function `plot_barchart()`, applying it to each row at a time.
142+
Again, using `mutate()` I can create a new column called `barchart` and I can `map()` the function `plot_barchart()`, applying it to each row at a time.
143143

144144
```{r}
145145
graphs <-
@@ -163,7 +163,7 @@ processed_staff |>
163163
)
164164
```
165165

166-
![An example bar chart plot](example_bar_chart.png)
166+
![An example bar chart plot](example_bar_chart.png){fig-alt="A horizontally placed bar chart example with categories for Ambulance staff, Doctors, Midwives and Nurses as specific bars across sections for 7 Hospital and Ambulance Trusts"}
167167

168168
## Putting it all together
169169

@@ -197,4 +197,4 @@ purrr::walk2(
197197
```
198198

199199
By keeping everything together in one nested structure, I personally find it much easier to keep track of my analyses.
200-
If you're doing a more complex or permenant analysis, you might want to consider setting up a more formal data processing pipeline, and following RAP principals.
200+
If you're doing a more complex or permanent analysis, you might want to consider setting up a more formal data processing pipeline, and following RAP principals.

blogs/posts/2024-11-29-mapping-my-r-learning/R textile map.jpg renamed to blogs/posts/2024-11-29-mapping-my-r-learning/R_textile_map.jpg

File renamed without changes.

blogs/posts/2024-11-29-mapping-my-r-learning/Terrible map.png renamed to blogs/posts/2024-11-29-mapping-my-r-learning/Terrible_map.png

File renamed without changes.

blogs/posts/2024-11-29-mapping-my-r-learning/index.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A couple of years later, when I started my current job, I heard about the NHS-R
2121

2222
It seemed important to try and change my approach, so that learning R didn't seem so daunting. I came across the [aRtsy](https://cran.r-project.org/web/packages/aRtsy/readme/README.html) package and was amazed by the colourful and intricate artwork that it could produce. But better still, all of the code was open-source. I experimented with the code, making very small changes to see what kind of images it would create.
2323

24-
![An image generated using the [aRtsy](https://cran.r-project.org/web/packages/aRtsy/readme/README.html) package and the [canvas_nebula](https://koenderks.github.io/aRtsy/#nebula) function](Nebula.jpg)
24+
![An image generated using the [aRtsy](https://cran.r-project.org/web/packages/aRtsy/readme/README.html) package and the [canvas_nebula](https://koenderks.github.io/aRtsy/#nebula){fig.alt="An abstract art piece with shades of blue colour that give it an almost organic or cloud appearance"} function](Nebula.jpg)
2525

2626
I also discovered colour palettes such as those in the [wesanderson](https://github.com/karthik/wesanderson) package, and tried experimenting with those along with the generative art functions. I soon found that my fear of R was quickly replaced by a geeky fascination with all of the beautiful artwork that could be created with only a few lines of code. It felt like a low-stakes situation, because the worst that could happen was that the code wouldn't work. Suddenly, the process of coding felt less intimidating, and it had opened up a wealth of possibilities[^1].
2727

@@ -57,7 +57,7 @@ Over time I understood that failure is part of the learning journey, and a helpf
5757

5858
As well as providing some humour to contrast with the often frustrating process of learning to code, these failures also helped me to get unstuck. More often than not, they were a catalyst for problem-solving as they provided useful information about what specific aspect of the code had gone wrong, which would give me a clue about what I needed to look into to fix the problem.
5959

60-
![This is an example of one of the terrible maps I accidentally made, where the map ended up so small it could have been a data point, the axes were changed beyond recognition, and one of the map markers, which was supposed to be located in the North of England, ended up with coordinates somewhere in the Atlantic Ocean.](Terrible%20map.png){fig-align="center"}
60+
![This is an example of one of the terrible maps I accidentally made, where the map ended up so small it could have been a data point, the axes were changed beyond recognition, and one of the map markers, which was supposed to be located in the North of England, ended up with coordinates somewhere in the Atlantic Ocean.](Terrible_map.png){fig-alt="A chart with axes latitude and logitude that has been stretched so the chart itself is just a centimetre or so across but many centimetres from top to bottom. A very small country shaped blob can be seen at the very top and to the side of the chart the population density 2021 key is more clearly viewable." fig-align="center"}
6161

6262
8. **I looked for inspiration to encourage me to keep going**
6363

@@ -71,9 +71,9 @@ Throughout my R learning journey, I have found that coding has been a useful con
7171

7272
I realised this a few months ago when my friend got me a beginner's embroidery kit, and as I followed the pattern and learned how to create the different types of embroidery stitch, I reflected that just like with the embroidery pattern I was working on, I needed to structure the coding for the map in [layers](https://ggplot2.tidyverse.org/reference/layer_geoms.html#:~:text=In%20ggplot2%2C%20a%20plot%20in,displayed%2C%20not%20what%20is%20displayed.). This led me to approach the process like I would for an art project[^4] to identify what I needed to do to adequately visualise both types of data that I wanted to include in the map.
7373

74-
[^4]: Throughout the journey I have realised that thinking about the problem like an artist has been very helpful, because it allows me to use a similarly iterative approach. I wanted my choropleth maps to show both the population density and the underlying terrain when superimposed. To do this, I used the [colorbrewer2](https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3) tool to test out different colour palettes, and changed the opacity and terrain to identify which colours would clearly to show the population data and the terrain underneath. The tool let me test this on an example map and showed me the hexadecimal colour codes for the colours in the palettes. Once I had found some combinations that would likely work for my particular map, I then iteratively adjusted the aesthetics in my R code until I found a combination that worked for my data.  
74+
[^4]: Throughout the journey I have realised that thinking about the problem like an artist has been very helpful, because it allows me to use a similarly iterative approach. I wanted my choropleth maps to show both the population density and the underlying terrain when superimposed. To do this, I used the [colorbrewer2](https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3) tool to test out different colour palettes, and changed the opacity and terrain to identify which colours would clearly to show the population data and the terrain underneath. The tool let me test this on an example map and showed me the hexadecimal colour codes for the colours in the palettes. Once I had found some combinations that would likely work for my particular map, I then iteratively adjusted the aesthetics in my R code until I found a combination that worked for my data.
7575

76-
![An abstract textile art piece that I made to illustrate the blog post. This symbolises my non-linear R learning journey - with overlapping and convoluted pathways, dead ends, and roadblocks along the way.](R%20textile%20map.jpg){fig-alt="Textile art piece showing a map with the letter R - for decorative purposes only" fig-align="center" width="384"}
76+
![An abstract textile art piece that I made to illustrate the blog post. This symbolises my non-linear R learning journey - with overlapping and convoluted pathways, dead ends, and roadblocks along the way.](R_textile_map.jpg){fig-alt="Textile art piece showing a map with the letter R - for decorative purposes only" fig-align="center" width="384"}
7777

7878
10. **I started learning about how to stay involved in the community**
7979

blogs/posts/2024-12-04-gha-branch-preview/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Once the site has rendered, we just need to add a step to deploy the PR.
106106

107107
Now everytime a PR is created, or updated, the GitHub Action bot will spring into action.
108108

109-
![A screenshot of a GitHub PR. Under the description, there is a comment from the GitHub actions bot with links to the deployed PR.](deploy-pr-preview.PNG)\
109+
![A screenshot of a GitHub PR. Under the description, there is a comment from the GitHub actions bot with links to the deployed PR.](deploy-pr-preview.PNG){fig-alt="Screenshot of a conversation from GitHub with a GitHub action for the preview."}
110110

111111
## Adjusting the publish.yml
112112

blogs/posts/2025-05-06_NLP-hackathon/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ We decided to use some data from a recent survey, which needed to be categorised
3131

3232
Our mission was to develop a model to help the Evaluation team categorise responses quickly, with a reasonable degree of performance.
3333

34-
![Mission impossible](mission_impossible.jpg)
34+
![Mission impossible](mission_impossible.jpg){fig.alt="Film image of actor hanging from the ceiling with his legs higher than his head. He is facing a computer terminal which he is poised at a keyboard typing."}
3535

3636
## The Hackathon format
3737

blogs/posts/2025-05-16 data-science-as-a-product/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ execute:
1414
enabled: false
1515
---
1616

17-
![Data Science](StockCake-Healthcare Data Analysis_1747409640.jpg)
17+
![Data Science](StockCake-Healthcare Data Analysis_1747409640.jpg){fig.alt="Image of part of a person in view in a white coat with stethoscope with a pen in one hand which is poised over document on a clip pad of a bar chart. The person is holding a 3D bar chart type model in the other hand."}
1818

1919
Data science in healthcare is booming.
2020
Every day new advances emerge that promise to deepen understanding, improve screening or optimise treatments.

blogs/posts/2025-09-18_verifying_git_commits/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ format:
2323
Ever looked at a list of commits on GitHub and noticed ✅ green checks next to some commits, but not others?
2424
Wondered what they mean?
2525

26-
![Screenshot of the nhp_inputs repository, showing some verified commits and other unverified commits.](nhp_inputs-commits.png)
26+
![Screenshot of the nhp_inputs repository, showing some verified commits and other unverified commits.](nhp_inputs-commits.png){fig.alt="Screenshot of the Commit history view of GitHub with examples of both verified commits and unverified commits by the same person." width="100%"}
2727

2828
Here’s a screenshot of our [nhp_inputs](https://github.com/The-Strategy-Unit/nhp_inputs/commits/main/) repository.
2929
You can see that some commits (merge commits, specifically here) have those checks, while others don’t.
@@ -45,7 +45,7 @@ This isn’t just a GitHub feature; it’s built directly into Git.
4545

4646
Below is a screenshot of our [nhp_model](https://github.com/the-strategy-unit/nhp_model/commits/main), where all the commits I’ve authored have been signed with [my GPG key](https://keyserver.ubuntu.com/pks/lookup?search=8F3C2735D62D6993&fingerprint=on&op=index).
4747

48-
![Screenshot of the nhp_model repository, showing all commits are verified.](nhp_model-commits.png)
48+
![Screenshot of the nhp_model repository, showing all commits are verified.](nhp_model-commits.png){fig.alt="Screenshot of the Git commit history which are all verified and also a tool tip box showing details of the verification details: who did the commit and the GPG key along with verification date." width="100%"}
4949

5050
Setting up GPG can be a bit of a faff, but there’s an easier way: using SSH keys to sign commits.
5151
You may already have SSH set up for pushing and pulling from GitHub, so this is a no-brainer.

blogs/posts/2025-11-07_pandas_vs_polars/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Polars has been frequently discussed as a possible improvement over Pandas. With
3030
In this article, we'll share our experience reimplementing one of our core data processing modules from Pandas to Polars, including the challenges we faced, the benefits we've seen, and lessons learned along the way. You can find our [nhp_products](https://github.com/The-Strategy-Unit/nhp_products) code on GitHub. We've kept both implementations for comparison, with polars modules bearing a `_pl.py` suffix.
3131

3232
::: {layout-ncol=2}
33-
![Panda](./Rolling-Panda-1647869962.gif){height="200px"}
33+
![Panda](./Rolling-Panda-1647869962.gif){height="200px"}{fig.alt="Panda rolling down a hill" width="100%"}
3434

35-
![Polar bears](./playful-polar-bear-cubs.gif){height="200px"}
35+
![Polar bears](./playful-polar-bear-cubs.gif){height="200px"}{fig.alt="Two polar bear cubs playing in the snow, one goes up to the other, grabs it in a bite and they both slide down the snow turning over onto their backs." width="100%"}
3636
:::
3737

3838
## Background: The Detailed Results Processing Challenge

0 commit comments

Comments
 (0)