::install_github("ekholme/eemisc") remotes
What’s up, Jeans. This short post is targeting the very niche crowd of R users who also happen to love Tim and Christine, the main mommies of Your Mom’s House. Basically, I discovered the {beepr}
package a few days ago, which makes it easier you play short sound files through R, and so naturally my first thought was to “try it out” with a YMH drop. The result was 2 functions added to my personal/miscellaneous package, {eemisc}
:
big_time()
, which will play the “THIS SHIT IS BIG TIME” drop from the YMH intro, andbig_time_operator()
, which lets you wrap a function and play the “THIS SHIT IS BIG TIME” drop whenever you call that function.
I’ll demonstrate these below.
Setup
To use these functions, you’ll need my personal package, {eemisc}
, installed. You can install it via Github via the following command:
Eventually, I might put these functions into their own package, but for now they live in my odds-and-ends package.
Big Time
To play the “THIS SHIT IS BIG TIME” drop, you just need to call the function big_time()
:
library(eemisc)
big_time()
That’s it. That will play the drop.
Big Time Operator
But I took it a step further for all of my kings and queens above 18. The big_time_operator()
takes a function of your choosing and produces as its output a new function that wraps the input function with the “big time” drop. Want to let everyone know that taking the mean is big time?
<- big_time_operator(mean)
big_time_mean
<- 1:10
x
big_time_mean(x)
[1] 5.5
You can pass any function you want into big_time_operator()
to get the same effect.
Anyway, that’s all for now. Keep it high and tight, Jeans, and you bet I’m coming up in May.
Reuse
Citation
@online{ekholm2021,
author = {Ekholm, Eric},
title = {This {Code} Is {Big} {Time}},
date = {2021-04-25},
url = {https://www.ericekholm.com/posts/this-code-is-bigtime},
langid = {en}
}