Varia
The HealthyR advent calendar is based on “R for Health Data Science” by Harrison and Pius. Use JKL20 for 20% off, including free worldwide shipping.
🌟Day 12 – recoding factors 🌟
— Riinu Pius (@_Riinu_) December 12, 2022
Two rules of handling factors:
😻use library(forcats): https://t.co/V2S1cEcl7W
📊always plot before and after to double check
“R for Health Data Science” #HealthyR #rstats 📖:https://t.co/NnV8h0x3Ks pic.twitter.com/XCESIJwH5I
🌟Day 13 – tidyverse MVP: count()🌟
— Riinu Pius (@_Riinu_) December 13, 2022
Frequency table in a tidy format?
That’s what the count() function does. Add sort = TRUE to order the output by n (instead of
factor order or alphabetically)
“R for Health Data Science” #HealthyR #rstats:https://t.co/9JCgLDFK13 pic.twitter.com/47UKCERIed
🌟Day 14 – when R can’t maths🌟
— Riinu Pius (@_Riinu_) December 14, 2022
Computers don't think that 0.10 + 0.05 = 0.15
This can blindside people who usually deal with categorical variables 🙈
General explanation at: https://t.co/XPApo7a1fD
“R for Health Data Science” #HealthyR #rstats📖:https://t.co/9JCgLDFcbv pic.twitter.com/V3gIMJY88O
🌟Day 22 - #HealthyR #rstats Season's Greetings, Part 1/3🌟
— Riinu Pius (@_Riinu_) December 22, 2022
That's enough regression for this year!
Execute this code in your head or an IDE, further instalments coming on the remaining days of our Advent Calendar 2022 🎄https://t.co/vNmRmb6QrC pic.twitter.com/tK9S9MBJNj
🌟Day 23 - #HealthyR #rstats Season's Greetings, Part 2/3🌟
— Riinu Pius (@_Riinu_) December 23, 2022
Note the two different ways of creating data - tibble and tribble. This is useful if you need to make a reproducible example!
Anyone want to guess what tomorrow's single additional line is?https://t.co/46h6uHPCvL pic.twitter.com/kOfXIMdy2s
🌟Day 24 - Season's Greetings, Part 3/3🌟
— Riinu Pius (@_Riinu_) December 24, 2022
+ scale_fill_identity()
I use scale_fill_brewer() or scale_fill_manual() more, but this works well here 🎄
That's the #HealthyR #rstats Advent Calendar! Thank you for thinking along and happy holidays!https://t.co/XtbZe0vGI7 pic.twitter.com/aLcaN6iJuj
HealthyR: R for Health Data Science book and resources: https://healthyr.surgicalinformatics.org/