Peter Gray's Avatar

Peter Gray

@pgdataviz

Statistical Programmer (Epidemiologist by training) using #Rstats and #Python mostly. #DataScience #Dataviz https://pgdatavizandstats.netlify.app/

58
Followers
45
Following
60
Posts
28.06.2025
Joined
Posts Following

Latest posts by Peter Gray @pgdataviz

A bar chart showing that likligood meaning decreases with education level

A bar chart showing that likligood meaning decreases with education level

#TidyTuesday

Looks like Postgrads are the most pessimistic in terms of accepting the likelihood of something actually happening. Which, TBF, 100% tracks with my experience of working with postgrads.

Code Here: pgdatavizandstats.netlify.app/data_visuali...

10.03.2026 19:11 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Can't spell Tuesday either. Having a nightmare

06.03.2026 07:44 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
A graph

A graph

Very bad with these when compared with last year but here's my #TidyTuesday / #PydyTuesfay for tortoises

Code here: pgdatavizandstats.netlify.app/data_visuali...

06.03.2026 07:35 ๐Ÿ‘ 0 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
05.03.2026 10:26 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

A very disheartening aspect of my job is, when asking experienced colleagues for help with my analysis or debugging , is they'll either tell me to "chat with the AI" or send me a link to a chat they've been having with an AI. Not exactly conducive to my learning. #rstats

25.02.2026 09:46 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
OpenSAFELY news: you can apply to do non-COVID research, from today! | Bennett Institute for Applied Data Science We are delighted to announce that - from today - you can submit applications to the OpenSAFELY service for non-COVID-19 studies.

OpenSAFELY is open from today! Huge thanks to all who supported this vast collaboration: whole population GP data; in a productive platform; innovative privacy protections; unprecedented support from professions, privacy campaigners; &c

Now it's over to users!

www.bennett.ox.ac.uk/blog/2026/02...

23.02.2026 16:17 ๐Ÿ‘ 181 ๐Ÿ” 86 ๐Ÿ’ฌ 6 ๐Ÿ“Œ 17

To be Honest. If I did want to stir it up.

I much prefer for loops to lapply. They're easier to follow if you're looking at an old script you didn't develop yourself.

Caveat - most of my data is ADAM clinical trial data so its relatively small.

Caveat 2: Just do whatever works best for you

23.02.2026 18:13 ๐Ÿ‘ 12 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 2
Everyone fighing over TIbble versus DF 

>| vs %>%

Me: googling what mean means

Everyone fighing over TIbble versus DF >| vs %>% Me: googling what mean means

Me? I'm just happy to be here #rstats

23.02.2026 08:20 ๐Ÿ‘ 131 ๐Ÿ” 24 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 1
Layer plot of all the sheep in new Zealand over the years

Layer plot of all the sheep in new Zealand over the years

Welsh sheep are obviously the best sheep, but the kiwis do a good sheep too

Code Here: pgdatavizandstats.netlify.app/data_visuali...

#TidyTuesday | #dataviz | #ggplot2

17.02.2026 20:38 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
>>> def add_two_nums():

num1 = input("Enter the first number you want to add:

num2 = input("Enter the second number you want to add: ")

if num1.isdigit() and num2.isdigit():

pass

else:

print("Error: One or both of the numbers you entered are not numbers. Enter a number numbskull")

sum = num1 + num2

print(f"The sum of the two numbers is: {sum}")

... add_two_nums()

Enter the first number you want to add: 6

Enter the second number you want to add: 7

The sum of the two numbers is: 67

>>> def add_two_nums(): num1 = input("Enter the first number you want to add: num2 = input("Enter the second number you want to add: ") if num1.isdigit() and num2.isdigit(): pass else: print("Error: One or both of the numbers you entered are not numbers. Enter a number numbskull") sum = num1 + num2 print(f"The sum of the two numbers is: {sum}") ... add_two_nums() Enter the first number you want to add: 6 Enter the second number you want to add: 7 The sum of the two numbers is: 67

I don't use it very often but I may have to update the "I have strong skills in python" part of the CV

11.02.2026 11:34 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Sunburst chart

Sunburst chart

Quick sunburst plot in python this morning. Better labelling of each layer would have been nice but I couldn't work it out

Code Here: pgdatavizandstats.netlify.app/data_visuali...

#TidyTuesday | #dataviz | #ggplot2 | #pydyTuesday

03.02.2026 05:57 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Just found out that pressing Tab in the Linux Terminal autocompletes the file name. So much time checking spelling and making mistakes that could not have been wasted.

02.02.2026 13:00 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
A tree map of the various African languages

A tree map of the various African languages

Back after a nice, long, winter break. African Languages this week and a chance to try out Tree Maps

Code Here: pgdatavizandstats.netlify.app/data_visuali...

#TidyTuesday | #dataviz | #ggplot2

12.01.2026 19:20 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Flashed over Nobara during my daughter's nap. Installed like a charm and runs nicely and I've about 50 new headaches (mainly website related) to fix but

11.01.2026 12:42 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I like positron but I can't get the LaTeX compatibility to work in Quarto. I probably could but, RStudio just works, and I can't be bothered

10.01.2026 07:53 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Popped onto my Windows partition because I needed a Windows program. It decided to update itself without asking. It's now nerfed my Linux partition somehow and copilot has reactivated itself on the windows side.

Luckily everything is backed up.
It's time to wipe the laptop and go all in on Fedora

10.01.2026 07:52 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1

Has flashbacks to his master's thesis they he thought would be a good idea to write in LaTeX in RStudio

20.12.2025 14:04 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Epidemiology Matters Epidemiology Matters offers a new approach to understanding and identifying the causes of disease -- and with it, how to prevent disease and improve human health. Utilizing visual explanations and exa...

books.google.co.uk/books/about/...

Foundational reading during my master's

20.12.2025 13:44 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

One has to ask, did they even bother with a power review?

Still the paper got traction on the BBC and other news websites and, in the end, that's all that matters

17.12.2025 19:52 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Picture of Qar-tar prices in Qatar

Picture of Qar-tar prices in Qatar

Family/Christmas/Birthday/Work means this may be the last attempt at #TidyTuesday this year. First full year doing it and enjoyed. Not sure if I got better though!

Code Here: pgdatavizandstats.netlify.app/data_visuali...

#rstats | #tidyverse | #dataviz

09.12.2025 18:50 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
RStudio is using 88 Gb of RAM

RStudio is using 88 Gb of RAM

The adrenaline rush I am getting right now. This must be what Base jumping is like

28.11.2025 12:45 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Working with datasets that definitely require the use of data.table. Genuinely very impressive package #rstats

25.11.2025 18:32 ๐Ÿ‘ 6 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Here's a good one. Rendering my quarto html in #positron causes loads of errors implying that quarto isn't installed correctly (I've uninstalled and reinstalled multiple times) but if render the same html in #RStudio, it renders with no drama

24.11.2025 16:56 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
A word cloud of the words in Sherlock Holmes 

Man, one are the two biggest words

A word cloud of the words in Sherlock Holmes Man, one are the two biggest words

Tried doing a World cloud of the words in the entire Sherlock Holmes in python with a nasty head cold - can't recommend the head cold part.

Code: pgdatavizandstats.netlify.app/datavis

#PydyTuesday | #TidyTuesday | #Python

18.11.2025 05:50 ๐Ÿ‘ 12 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Two area plots of TB deaths hiv versus non hiv

Two area plots of TB deaths hiv versus non hiv

This week's submission for #PydyTuesday. Missed ggplot slot when trying to make this plot

Code here: pgdatavizandstats.netlify.app/data_visuali...

#rstats | #python | #dataviz | #TidyTuesday

11.11.2025 17:20 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Sorry for the late reply, but thank you.

This is a much slicker/fancier version of what I did in the end. I will keep this for next time though!

10.11.2025 09:16 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I know I think it's more "honourable", if that's the right word to do it in matplotlib or seaborn. But they have ported over the best visualisation package ever created in plotnine so I'm not sure why I don't just use that

06.11.2025 18:41 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Haha tbh I'm not sure it's worth the effort. Still it's good to know the option is there

06.11.2025 16:36 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Post image

My submission for #PydyTuesday. A quick jaunt back to Python and some Violin plots

Code here: pgdatavizandstats.netlify.app/data_visuali...

#rstats | #python | #dataviz | #TidyTuesday

06.11.2025 11:01 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Thank you, that did do the trick, with a lot of manually programming the x and y coordinates. Lifesaver - thank you!

05.11.2025 15:05 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0