R-Package Advent Calendar 2020
This year, I started a Twitter advent calendar showcasing one R-package per day, each of which I find essential for my work. The aim is to highlight useful packages, both familiar and lesser-known, and offer insights into their functionalities. Follow along to discover packages from CRAN, BioConductor, GitHub, and more, and perhaps find new tools to enhance your work.
This year has been truly something different for us all. Blogging has definitely taken a toll, as real life has been quite something to handle. So, in order to end the year with a bang, and something fun, I started a twitter advent calendar!
The advent calendar is one R-package per day that I personally use and find very useful in my work. The hope is that it would give people a mix of familiar and less familiar packages that might help their work too. In each package sub-thread, I try to highlight some functions or functionality from the various packages that I like in particular. There are so many packages on CRAN and other online repositories (BioConductor, GitHub, Gitlab, NeuroConductor etc.), that it can be hard to find something to help you along. I hope this atleast points you in a good direction. There are other packages that could cover some or all of the same functionality as the ones listed here, but these are the ones I personally use.
How I selected a package per day
Before I started the calendar (one day late!), I sat down and wrote a list of all the packages I wanted in my advent calendar.
The rules were:
- One package per day
- I must personally use it
- I can find easy examples of why I like using it
The point of the calendar was to do something fun, that others might find useful, and that would highlight and give credit to great packages. But I also did not have the possibility of spending lots of time researching other alternative options or the like, it was to be a light-weight and easy thing for me to do.
So i wrote down my list in R:
pks <- c("usethis", "rio", "distill",
"boom", "patchwork", "holepunch",
"learnr", "xaringan", "magick",
"nettskjemar", "pkgdown", "here",
"rticles", "vitae", "xaringanExtra",
"stringr", "forcats", "lubridate",
"glue", "janitor", "pbmcapply",
"kableExtra", "papayar", "reactable")
Then I made a little function that would draw a random one every time I ran it, while omitting the ones I had drawn before
get_todays <- function(completed, pkgs){
days <- 1:24
days <- days[!days %in% completed]
k <- sample(days, 1)
cat(pkgs[k], "\n")
k
}
Now I had an itty bitty function that would draw from my list by random each day, so I did not have to think about the order of things. Every day I drew a new package, tweeted about it, and added it to the completed list.
completed <- c(3, 12, 19, 6, 8, 1,
10, 16, 22, 5,
17, 21, 18, 9, 7)
get_todays(completed, pks)
## rticles
## [1] 13
Now, there is a slight problem with my function. I forgot to add a random seed, as pointed out by Tobias Busch
It's a good start, but for full reproducibility it needs a random seed! And more #Blockchain, of course! 😋
— Tobias Busch (@tobilottii) December 2, 2020
So, always room for improvement! If I do something similar next year, I’ll be sure to add that!
Have a great Christmas, everyone!
2020-r-package-advent-calendar-2020,
author = "Dr. Mowinckel",
title = "R-Package Advent Calendar 2020",
url = "https://drmowinckels.io/blog/2020/r-package-advent-calendar/",
year = 2020,
doi = "https://www.doi.org/10.5281/zenodo.13273508",
updated = "Dec 11, 2024"
}