Sign in

appliedepi.bsky.social

@appliedepi.bsky.social
380 followers 28 following 73 posts

Improving Applied Epidemiology worldwide. Increasing the knowledge and resources of Epidemiologists no matter who or where they are. Creator of the EpiRHandbook: epirhandbook.com

PostsRepliesMedia
appliedepi.bsky.social @appliedepi.bsky.social · 11/06/2026
📢 Use R for public health - Enroll now! Synchronous courses with 1-to-1 tutoring by applied epidemiologists 😲. Intro & advanced (GIS, time series, Shiny, Quarto, statistics), in English and Spanish, options for all time zones. appliedepi.org/training/pub...
screenshot of Applied Epi's website showing upcoming courses and registration buttons
000
appliedepi.bsky.social @appliedepi.bsky.social · 12/03/2026
🗣️ Applied Epi is hiring! Seeking R users in public health to support epidemiologists globally in English and French, Spanish, or Portuguese, as: 🔵 Instructors: Lead online R courses 🟡 Technicians: 1-on-1 online R mentorship Apply by April 5th: 🔗 appliedepi.org/about/join.h... #PublicHealth #Epi
022
appliedepi.bsky.social @appliedepi.bsky.social · 13/03/2025
“I’ve taken several R trainings - this is the BEST!” 📢 New courses posted! Intro to R for public health 🗓️ 40 hours part-time, synchronous, with unlimited 1-on-1 coaching and options for ALL time zones. ✏️ Register: appliedepi.org/training/pub...
013
appliedepi.bsky.social @appliedepi.bsky.social · 03/02/2025
📢 Last week to apply for the Applied Epi scholarships! Transition your team to R with free or discounted courses and services. Why apply? ✔️ Full or partial scholarships ✔️ Focused on strengthening public health capacity 🗓️ Apply by Feb 10, 2025! 🌐 appliedepi.org/training/scholarships-ae
013
appliedepi.bsky.social @appliedepi.bsky.social · 21/01/2025
🚨 Applications are NOW OPEN for Applied Epi’s 2025 scholarships! 🚨 💡 For teams in low- & middle-income countries working in epidemiology, this is your chance to access funding for courses and support services that help transition to R. 🗓️ Deadline: Feb 10, 2025 🌐 Apply here: appliedepi.org
054
appliedepi.bsky.social @appliedepi.bsky.social · 17/01/2025
🎉 R scholarship applications open on January 20! If your team (government or nonprofit) works in applied epidemiology in a low- or middle-income country, you could get access to our Intro to R course and Support Desk! Details: appliedepi.org/training/sch... #Rstats #epitwitter
077
appliedepi.bsky.social @appliedepi.bsky.social · 24/12/2024
Repeatedly rerunning the code is quite fun
110
appliedepi.bsky.social @appliedepi.bsky.social · 24/12/2024
And how did we get Santa's coordinates? Since he didn't share his location, we created a function (get_random_night_coords()) to randomly generate coordinates of a location with a current local time between 11pm and 3am, assuming those are his working hours! Close enough!
120
appliedepi.bsky.social @appliedepi.bsky.social · 24/12/2024
Both of these figures are created with ggplot2, and use a saved PNG file of Santa. geom_image() from {ggimage} places the image at specified coordinates, reading from the file path. Here's the ggplot code for the second figure:
120
appliedepi.bsky.social @appliedepi.bsky.social · 24/12/2024
And if you want his current location:
110
appliedepi.bsky.social @appliedepi.bsky.social · 24/12/2024
🎄 Merry Christmas Eve, everyone! 🎄 To wrap up this advent calendar, here’s our final tip: Did you know you can use your own images in ggplot? Check out this festive example with a cartoon of Santa —on his (surprisingly inefficient?) route tonight! 🎅✨ #DataViz #RStats
130
appliedepi.bsky.social @appliedepi.bsky.social · 23/12/2024
Today's post is for anyone with bdays this time of the year. We see you! This includes our Exec Director, an expert in "combo Xmas/bday" presents! Happy birthday Neale! 🎂 On that note, ever work with multiple date columns but need to pick one? Use coalesce() to easily prioritize a value! #Rstats
1192
appliedepi.bsky.social @appliedepi.bsky.social · 22/12/2024
Here's the code if you like the "minimalist" aesthetic. That said, it does show the versality of ggplot!
110
appliedepi.bsky.social @appliedepi.bsky.social · 22/12/2024
P.s. Before finding the {christmas} package I was ready to make this the main event for this post:
100
appliedepi.bsky.social @appliedepi.bsky.social · 22/12/2024
🎄Day 22: An R Christmas Tree 🎄 There's still time to write your Christmas cards! And what better captures the yuletide spirit than...R... Seriously though, check out the {christmas} package by Jose Barrera-Gomez.. Stunning!
110
appliedepi.bsky.social @appliedepi.bsky.social · 22/12/2024
Want to further customize colours? 🎨 The example above uses the same colour palette for each plot, with scale_fill_brewer(). For custom colours, you can also define a palette inside scale_fill_manual() - or as a separate object that you refer to (as discussed yesterday).
210
appliedepi.bsky.social @appliedepi.bsky.social · 22/12/2024
🎄Day 21: Ggplot efficiency part 3🎄 Need many plots with the same style/formatting but slightly different inputs? 💡Create a custom ggplot function! Define your plot upfront in the function, with all the long formatting code. Then run the function for each new plot with different inputs.
211011
appliedepi.bsky.social @appliedepi.bsky.social · 21/12/2024
🎄Day 20: Ggplot efficiency: part 2 🎄 Visualizing the same variables in different ways (e.g. sex by time/place)? 💡Tip: Easily standardize colour palettes by defining them once at the start of your code. Then reuse the palettes within scale_fill_manual() or scale_color_manual() across plots.
130
appliedepi.bsky.social @appliedepi.bsky.social · 20/12/2024
If you want to reset, you can define theme_set() as theme_gray(), which is the default ggplot theme. Or, restart your R session.
110
appliedepi.bsky.social @appliedepi.bsky.social · 20/12/2024
🎄Day 19: Ggplot efficiency: part 1🎄 Do you need a consistent plot style for a document? Try theme_set()🎨 Define the look of fonts, grid lines, backgrounds, axis text etc once inside theme_set(). This will apply to all subsequent ggplots in your R session. No need for long theme() code per plot!
1100
appliedepi.bsky.social @appliedepi.bsky.social · 18/12/2024
🎄Day 18 🎄 Having a rough day? The {praise} package is there for you. Go on, give praise() a whirl.... ♥️
1204
appliedepi.bsky.social @appliedepi.bsky.social · 17/12/2024
And finally, here's a neat way to copy code to just above or below the original. Highlight code and then press: 🪟 Shift + Alt + Up/Down (Windows) 🍎 Option + Command + Up/Down (Mac)
120
appliedepi.bsky.social @appliedepi.bsky.social · 17/12/2024
Or try moving code up and down your script easily. Do this by highlighting code and then: 🪟 Alt + Up/Down (Windows) 🍎 Option + Up/Down (Mac)
130
appliedepi.bsky.social @appliedepi.bsky.social · 17/12/2024
🎄Day 17: RStudio magic🎄 Want to be in multiple places at once over the holidays? We can't help you with that. But - we can show you how to type in multiple places at once in RStudio! 😮 Useful when you need to make the same edit across your code but Find + Replace isn't suitable.
1101
appliedepi.bsky.social @appliedepi.bsky.social · 15/12/2024
To make "ñ" and "ñ" equal in R, you can normalize their Unicode forms using the {stringi} package, with the stri_trans_nfc() function.
100
appliedepi.bsky.social @appliedepi.bsky.social · 15/12/2024
🎄Day 14: Quiz!🎄 Why do these two seemingly identical characters not equal each other in R?
050
appliedepi.bsky.social @appliedepi.bsky.social · 12/12/2024
🎄Day 12: Assessing missing data🎄 Epis know well that missingness can skew analyses, so needs careful review. No fear, {naniar} can help! E.g.: ☑️pct_miss_case(): to check % of rows with NAs ☑️gg_miss_var(): to quickly visualize missingness by column See more in Ch. 20 of the EpiRHandbook.com!
051
appliedepi.bsky.social @appliedepi.bsky.social · 11/12/2024
You can get more complex placements by combining different mathematical operators, as you can see with this example. Plus you can add titles and captions, share legends, and several other customizations. Enjoy! See more at: cran.r-project.org/web/packages...
010
appliedepi.bsky.social @appliedepi.bsky.social · 11/12/2024
If you know how to add (+) and divide (/), you can use patchwork. Want one figure showing two separately generated ggplots side by side? Just add them!
110
appliedepi.bsky.social @appliedepi.bsky.social · 11/12/2024
🎄Day 11 🎄: Multi-panel figures! The R package {patchwork} makes professional-looking multi-panel figures like this SUPER easy to do. This means more efficient story telling, saved space, and clearer comparisons between groups. #r #rstats #epi
12911
appliedepi.bsky.social @appliedepi.bsky.social · 10/12/2024
To enable these features, go to your Global Options, Code, and tick these two boxes under ‘Syntax’. Happy coding! #rstats #lifehack #epi #r
150
appliedepi.bsky.social @appliedepi.bsky.social · 10/12/2024
Day 10: Code readability! Are you making life harder for yourself in R? Or are you using rainbow parentheses and highlighted functions!? Which one does your code look like?
192
appliedepi.bsky.social @appliedepi.bsky.social · 09/12/2024
Day 9: Where do the R version names come from? Run R.version on your console to see your version number and name. The current one is 4.4.2: “Pile of Leaves”. Internet chat suggests these names are all inspired by the Peanuts comic strip. And sure enough… #r #rstats #charliebrown #peanuts 🥜
1132
appliedepi.bsky.social @appliedepi.bsky.social · 08/12/2024
Day 8: Heatmaps! Epicurves are great when you have a few areas. But for dozens or hundreds of categories, if you want to see patterns then heatmaps are the way to go! epirhandbook.com/new_pages/he...
150
appliedepi.bsky.social @appliedepi.bsky.social · 07/12/2024
Our personal favourite flextable feature: colour-coding cells to highlight content. 🔴 Values too high? 🟢 Numbers on target? Ideal for sitreps to quickly draw eyes to key stats!
131
appliedepi.bsky.social @appliedepi.bsky.social · 07/12/2024
Start by passing your dataframe through the flextable function. Then add on the other functions. Your code might get long, but don't be scared off - they're just sensible building blocks! For example - want to adjust your column widths? Use the function 'width'!
100
appliedepi.bsky.social @appliedepi.bsky.social · 07/12/2024
Day 7: Publication-ready tables! How cool is it to run code and instantly generate a fully formatted table! With flextable, you can: 🖍️ Style fonts 🔗 Merge cells 📑 Add layered headings 📐 Adjust dimensions Learn about it in the EpiRHandbook: epirhandbook.com/en/new_pages... #rstats #epi #r
162
appliedepi.bsky.social @appliedepi.bsky.social · 07/12/2024
post someone you’ve been told you look like, who you definitely don’t look like
010