📢 Results for yesterday's poll are in everyone! Thank you all for your participation! 🙏There is so much to talk about, so today, let's start discussing the first question: why have you not tried programming yet? 🧐
🧵 1/6
Most often (43%), the reason to not learn coding is lack of time. Uff! Having no time is always an issue, trust me! There will never be enough time to do all the things we want
🧵 2/6
But I do think that if there is something that you are interested in, not necessarily learning how to code, there will always be some time here and there to spare
🧵 2.1/6
I am no time manager guru to be honest 😅, but things that have helped me are to set specific slots to do certain activities that I really want to learn.. The most important thing for me is that they are not a burden but somethign I look forward to! What works for you?
🧵 2.2/6
Next answer: 28% referred to a lack of technical background... this option reminds me of a friend of mine. She is a literature masters student and considers herself not comfortable with computers in general
🧵 3/6
But, she is fascinated by the things one can do, so she decided to join a short intro to Python course. I can only tell you she looked so excited when telling me about how she managed to print 'Hello, world!' to a console that I wanted to hug her tight!
🧵 3.1/6
This story will not end in 'now she is the core developer of numpy', or something like this, but it does end with her feeling very proud of herself for writing her first piece of software! And me proud of her!
🧵 3.2/6
So, give yourself a chance, you never now what can come out of some very simple lessons. Once you get the hang of it, you'll be unstopabble!
🧵 3.3/6
Moving on, I was surprised to see that no one mentioned not being interested in coding. I have the feeling my sample is a bit biased 😅, but it is really nice to see the enthusiasm!
🧵 4/6
Last option was other reasons. Here I had only one comment with an explanation, saying other people in their team can code faster and better. I can say for my personal experience, I used to have this view as well.
🧵 5/6
However, learning to code helped me to be in control of my analysis and also understand what the rest is doing, by reading their code. It is not about being the better coder, but to be able to keep up with the things that happen in the background
🧵 5.1/6
What motivated you all to start coding? Any other tips for people who are interested but have no time / technical background / motivation?
🧵 6/6
• • •
Missing some Tweet in this thread? You can try to
force a refresh
@quarto_pub First step for me in doing something like this: Figma. It's a really useful tool for playing around with a layout before you try to implement it in code.
Here's the basic layout I built to figure out where everything should go.
@quarto_pub Next, fonts. For this one, I was looking for something that says "I know what I'm doing but I'm also approachable" as that was the vibe I got from folks at the @NHSrCommunity a few weeks ago.
I went with Nunito Sans, and found a "slab" font with a similar shape: Zilla Slab.
Day 5: A worked example pulling all this together to build an Rmd-to-pdf template (using📦 {pagedown}) for @R_Girls_School!
There will be very little code in this one, because we're eagerly awaiting the Quarto-to-pdf equivalent, so I'm focusing instead on the principles I used.
@R_Girls_School Rewind. I first heard about @R_Girls_School at the @NHSrCommunity conference, where the head teacher of Green Oak Academy, Dr Razia Ghani, came to share how they'd been teaching #rstats skills as part of lessons based on key subject of the curriculum (maths, geography, etc).
@R_Girls_School@NHSrCommunity Dr Ghani shared some quotes from the pupils about the hugely positive impact these lessons had on their interest in the subjects and on their confidence in their own ability to learn. There was quite a crowd around her at the coffee break keen to offer help and encouragement!
Day 3: Writing functions to create parameterised graphs
So, we've picked our colours and set up a nice theme. We already know we want to apply this to all our plots but what if we could reuse the same plot code across different bits of the data?
Easy, let's make a function!
First, let's set up our plot. We're going to plot the number of penguins from each species within our dataset. We're using ggchicklet::geom_chicklet(), an anchor colour which is a blend of the blue and purple I mentioned on Day 1 and theme_rladiesdemo() which we built on Day 2.
Now let's add some labels, so we can state the number of penguins in each species, along with the mean body mass.
To do this, I'm using my go-to #rstats annotation package {ggtext}, which allows us to apply some CSS to create the text hierarchy principles from Day 2.
2) Fonts. Picking fonts can be really tricky, but there are some really great resources out there (see below, where we're back to our "let others help you" mantra!).
Here, I've simply applied the fonts from my own website, changing the family element of element_text().
3) Text size. You can manipulate text size within theme() either by setting absolute sizes (e.g. size = 16), or relative sizes (e.g. size = rel(1.2)).
The relative size is a good idea if you're going to reuse this theme: change the base size as needed and everything follows!
At this point, we've done most of the work, but we can still make our data story easier to take in by giving everything a bit more space to breathe.
First, let's move the legend to reduce unnecessary eye movements, fade the grid, and remove an unnecessary axis title.
Here are three reasons why I think you should do this:
- Help orient your readers with text hierarchy
- Give everything some space to breathe
- Achieve effortless consistency with one extra line of code
Sound good? Let's dig in!
My starting point for creating a custom theme is typically theme_minimal(). It has sensible defaults such as relative text size and margins that we can build on, by just replacing some elements.
🤫 I'm going to let you in on a secret... I find picking colours really tricky! Thankfully, I've found few ways round that.
My top tip is to let others help you! But first, a broad principle...
When picking colours for story telling, I try to make the colours as intuitive as possible.
Here's the adventure I took the Palmer Penguins on in a recent talk involving the #GreatPenguinBakeOff. See if you can guess the details. (The next tweet should give you a few clues!)
It's not about making your plots into a guessing game. It's about reducing cognitive load by making it easy to remember what's what.
And this allows me to illustrate one way to let others help you: photos! All of the colours in the previous plots were taken from these photos.